from the docs: If you'd prefer Django didn't create a backwards relation, set related_name to '+'. For example, this will ensure that the Usermodel won't get a backwards relation to this model:
If your Model is called: MyModel then you could do for a user instance: user.mymodel_set , but if you define a '+’ as related_name, you can’t because django does not create the ‘reverse relationship’ On 18.01.2011, at 10:00, Praveen Krishna R wrote: > Hi, > > Could any of you tell me about the things which I should take care while > defining a > foreign key to User model. ? > > Do I need to define the related_name ='+' as it says in the documentation? > and what does it do? > > user = models.ForeignKey(User, related_name='+') > > -- > Praveen Krishna R > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.