Hello, I just started using django two days ago. I tried your method and
>>> p=Poll.objects.all()[0] >>> p #results in <Poll: Poll object> >>> type(p) #results in <class 'polls.models.Poll'> >>> dir(p) #gives an error ['DoesNotExist', 'MultipleObjectsReturned', '__class__', '__delattr__' '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '_hash__', '__init__', '__metaclass__', '__module__', '__ne__', '__new__, '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof_', '__str__', '__subclasshook__', '__weakref__', '_base_manager', '_deault_manager', '_deferred', '_get_FIELD_display', '_get_next_or_previos_by_FIELD', '_get_next_or_previous_in_order', '_get_pk_val', '_get_unque_checks', '_meta', '_perform_date_checks', '_perform_unique_checks' '_set_pk_val', '_state', '_unicode_', 'choice_set', 'clean', 'clean_felds', 'date_error_message', 'delete', 'full_clean', 'get_next_by_pub_ate', 'get_previous_by_pub_date', 'id', 'objects', 'pk', 'prepare_dataase_save', 'pub_date', 'question', 'save', 'save_base', 'serializable_alue', 'unique_error_message', 'validate_unique'] --------------------- >>> p =Poll.objects.all() >>> for x in p: . . . print x (indent this line four spaces, hit return key once) . . . (hit return key again) #results in Poll object ----------- help 0_0 On Jun 14, 9:55 pm, Micky Hulse <rgmi...@gmail.com> wrote: > On Tue, Jun 14, 2011 at 11:01 AM, Kyle Latham <kly.lat...@gmail.com> wrote: > >>>>Poll.objects.all() > > [<Poll:Pollobject>] > > What do you get when you try: > > >>> p =Poll.objects.all()[0] > >>> p > >>> type(p) > >>> dir(p) > > Try this too: > > >>> p =Poll.objects.all() > >>> for x in p: > > . . . print x (indent this line four spaces, hit return key once) > . . . (hit return key again) > > Does any of that help? > > Good luck! > > Cheers, > Micky -- 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.