On May 4, 12:03 am, George Song <[email protected]> wrote:
> On 5/3/2009 8:17 PM, nbv4 wrote:
>
>
>
> > On May 3, 3:51 pm, Ramiro Morales <[email protected]> wrote:
> >> On Sun, May 3, 2009 at 4:26 PM, nbv4 <[email protected]> wrote:
>
> >>> Everything is fine and dandy, except for when I want to use the admin
> >>> interface to create a new route. All I see is a dropdown for the
> >>> "often" field. I have to go to the RouteBase section of the admin to
> >>> add the rest. Normally if there is a ManyToMany field, in the admin
> >>> interface there will be a little green plus sign that you can use to
> >>> create a new object to attach. If the "through" option is used, it
> >>> doesn't show up. Why? Is there a way to change this behavior? Is this
> >>> a bug or is there a reason for this?
> >> See
>
> >>http://docs.djangoproject.com/en/dev/ref/contrib/admin/#working-with-...
>
> > Gee whiz thanks a lot.
>
> > I've got one more problem. How do I access the information from within
> > that intermediate class?
>
> > I can do:
> > ----------
> > r = Route.objects.get(pk=1)
> > r.bases.all()
> > --------
>
> > and r will be a list of all bases. From within that Route object (r),
> > is there anyway to get access to the RouteBase attributes? Something
> > like r.sequence?
>
> The intermediate class is no different than any other many-to-one
> related classes:
> <http://docs.djangoproject.com/en/dev/topics/db/queries/#related-objects>
>
It's not possible to get those attributes unless I make another query?
Basically I have one object that has a TON of related fields, some
ForeignKey, some ManyToMany. Is it possible to pass just one instance
of that one object to a Template and have access to the whole shebang
through that one object? The link you gave me suggests that, but it
just doesn't seem right...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---