Am Montag, 9. Oktober 2006 09:07 schrieb Holger Schurig:
> > agreed, in a perfect world i would parse the log files. But
> > sometimes you don't have access to a cron daemon.
>
> In this case you should read the database API documentation page.
> Then your code looks something like this:
>
> from django.shortcuts import get_object_or_404
> from my.models import MyObj
>
> def detail(post_id):
>     myobj = get_object_or_404(MyObj, id=post_id)
>     myobj.count += 1
>     myobj.save()

Allright, thank you! Somehow it felt wrong to put it into the view.

In this case the FAQ helped to understand. :)
http://www.djangoproject.com/documentation/faq/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names

-- 
Dirk Eschler <mailto:[EMAIL PROTECTED]>
http://www.krusader.org

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to