Hi,

this is probably a  really basic question, but i can't find the answer
anywhere.

I need to get data from a model and use it in the view (views.py),
before I pass it to the template. However, the result I get back (when
i examine the local vars) has only the value returned by the __unicode
function, in this instance, the "title" column.

I need the title to continue to be what is returned by unicode but i
need access to a different field in that model  and pass it to a third
party api.

essentially my code would looks like this:

from models import Video

def get_video_ids:
 vids = Video.objects.all()

 for vids in vid
  do stuff

the vids variable contains a list like this: [Video: vid title one,
Video: vid title two]

I essentially need the id.

I have tried different ways of extracting, but they fail.

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