How to store multiple object reference in one field?

16 views
Skip to first unread message

Hasanul Islam

unread,
Dec 26, 2017, 11:27:22 AM12/26/17
to Django users
Suppose, I have a model 
                class Project(models.Model):
                        name = models.CharField(max_length=50)
Another model,
               class Manager(models.Model)
                         name = models.CharField(max_length = 50)
                         projects = ArrayField( models.Foreignkey(Project, on_delete=models.PROTECT) )

Here, projects field would be an array of Project object. But it is PostgreSQL specific. How can I implement this so that it will be useful for every database?               

Matthew Pava

unread,
Dec 26, 2017, 11:56:45 AM12/26/17
to django...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1f3a4691-fb23-4a42-9387-ea67562635c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages