Re: ForeignKey dropdown list in custom view

2006-02-18 Thread bsnipes
Thanks for clarifying that for me. I can access all of the info in the detail view now. Brian --~--~-~--~~~---~--~~ 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

Re: ForeignKey dropdown list in custom view

2006-02-18 Thread Luke Plant
On Saturday 18 February 2006 03:12, bsnipes wrote: > I finally see! What is returned by get_object() is dependent upon > the results of the __repr__ method in the model setup. Hmmm. now > to get it into a parsable format... No, get_object() gets the object itself, with .name and all the oth

Re: ForeignKey dropdown list in custom view

2006-02-17 Thread bsnipes
I finally see! What is returned by get_object() is dependent upon the results of the __repr__ method in the model setup. Hmmm. now to get it into a parsable format... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: ForeignKey dropdown list in custom view

2006-02-17 Thread bsnipes
Don't know if this helps, but this is what I get from the shell: >>> from django.models.foodlog import foods,periods >>> foods.get_object(pk=1) 1 >>> foods.get_values(pk=1) [{'eat_date': datetime.datetime(2006, 2, 10, 19, 51), 'period_id': 3, 'id': 1, 'calories': 400, 'description': 'mac and chee

Re: ForeignKey dropdown list in custom view

2006-02-17 Thread bsnipes
Still must be doing something wrong. My urls.py has: (r'^foodlog/$', 'foodlog.views.index'), (r'^foodlog/(\d+)/$', 'foodlog.views.details'), My views.py has: - snip def index(request): latest_log_entries = foods.get_list() return render_to_response('foodlog/index',

Re: ForeignKey dropdown list in custom view

2006-02-17 Thread Adrian Holovaty
On 2/16/06, bsnipes <[EMAIL PROTECTED]> wrote: > I am just learning Python and Django and can't seem to be able to > figure this out. As a test app I am trying to make a 'foodlog' app to > track food eaten, when, and calories. My model file looks like this: > > --- snip > from django.cor

ForeignKey dropdown list in custom view

2006-02-16 Thread bsnipes
I am just learning Python and Django and can't seem to be able to figure this out. As a test app I am trying to make a 'foodlog' app to track food eaten, when, and calories. My model file looks like this: --- snip from django.core import meta class Period(meta.Model): name = met