F
F
Friend2017-01-20 12:31:24
Django
Friend, 2017-01-20 12:31:24

How to use relations(foreign key, Many-to-many) in models?

I read the documentation on djbook, but I could not quite understand how it works. FK is one to many and M-to-M is many to many.
For example, there is a task to implement the ability to add friends or exchange messages. How can you do this with these relationships in models?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iegor, 2017-01-20
@iegor

ForeignKey - https://docs.djangoproject.com/en/1.10/ref/models/...
ManyToManyField - https://docs.djangoproject.com/en/1.10/ref/models/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question