Hey,
I didn't quite understand what you're trying to do, so I'm covering both
interpretations.

1- If you're trying to, for instance, get all the films an actor was in you
can, as explained here
https://docs.djangoproject.com/en/1.5/topics/db/queries/#many-to-many-relationships(the
link is for Django 1.5, but don't worry if you're using an older
version), use something like:

attore = Attore.objects.get(pk=1)  # Get an actor from the database
attore.film_set.all()  # Get the list of all the films the actor been in

2- If you're trying to filter Films based on actor information, you can do
something like this:

Film.objects.filter(attori__cognome='Travolta')  # Get all films that have
at least one actor with the last name Travolta


Now for something completely different, I don't know what are your
requisites, but do you really need classes (and then database tables) for
stuff like movie duration and release year? Seems like overkill and can end
up hurting performance.
Usually (not always) if you have a class with just one attribute, you don't
actually need a class.

I hope one of these was what you're looking for.

- Gabe

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to