Sorry if my question is a bit off topic, sometimes my mind tends to
forget that python has not been created just for django... and thanks
for the answer Andy.

Bastien

On Apr 30, 1:40 pm, Andy Mikhailenko <neith...@gmail.com> wrote:
> Hi, your question does not seem to be related to Django. Anyway:
>
> class A:
>     cnt = 0
>     def __init__(self):
>         A.cnt += 1
>
> If you want to count saved instances of a Django model, use
> MyModel.objects.count().
>
> Cheers,
> Andy
--~--~---------~--~----~------------~-------~--~----~
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