It's ok by me to return something generic or even raise an exception if I'm 
calling directly using RelatedStuff.objects.my_method().

Is it possible for my_method to access MainStuff instance or at least find 
out which way it is accessed?

Imagine I got a instance of MainStuff like this...
main = MainStuff.objects.get(id=1)

When I later call main.relatedstuff_set.my_method() I need "my_method" to 
have access to "main" to do some additional filtering 
and crunching depending on some of the fields in "main".

One other resort I possibly could do is some custom field instead, almost 
like the reverse generic relation using 
generic.GenericRelation. That would probably be a better pythonic/djangonic 
way of doing it but fixing that would probably mean more codeing and less 
progress for me. 
 

-- 
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.

Reply via email to