Just use ...
if data:
if data is empty, its not True for python...
On Tue, Sep 15, 2009 at 2:48 PM, Gonzillaaa 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.
>
>
> >
>
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.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" grou
2 matches
Mail list logo