Just use ... if data:
if data is empty, its not True for python... On Tue, Sep 15, 2009 at 2:48 PM, Gonzillaaa <gonzill...@gmail.com> wrote: > > in the following query: > data = Model.objects.filter(node_id=id) > > how do I check if data is empty before rendering or being redirected > to a 404? > > G. > > > > > -- Carlos Leite --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---