On 25 juil, 14:49, Tim Chase <[EMAIL PROTECTED]> wrote:
> When you add a foreign-key to your model, the referenced model
> gets a psedudo-attribute, usually called <whatever>_set which is
> the set of <whatever>s that have this attribute.  By adding the
> related_name, you provide a way to reference the Units for which
> a Personne is responsible.  Thus, it might make it clearer to use
> something like
>
>    related_name='managed_units'
>
> which allows you to iterate over the units a person manages:
>
>    for person in Personne.objects.select_related().all():
>      if person.managed_units:
>        print person, 'manages the following units:'
>        for unit in p.managed_units:
>          print '-', unit

thanks again for the full explanation and BRAVO to django for this.

the more I discover Django the more I love IT !!



--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to