> Den 27. okt. 2015 kl. 04.01 skrev gugeshi...@gmail.com:
>
> hi ,how are you
>
> i run
>
> myid=mymodel.objects.first().get('id',None)
>
> If there is a record, it's ok
>
> If there is no record, error info:
>
> AttributeError: 'NoneType' object has no attribute 'get'
>
>
> If there
hi ,how are you
i run
*myid=mymodel.objects.first().get('id',None) *
If there is a record, it's ok
If there is no record, error info:
*AttributeError: 'NoneType' object has no attribute 'get'*
If there is a record,Can you let it return an empty dictionary,
thank you
--
You received
2 matches
Mail list logo