Hi guys, im using generic view, i would like to update a field (most_view) in another database table.
How ill update or create a new register for "most view" when the user are reading a article?
ulrs.py
from Paso_a_Paso.noticias.models import Noticia
noticias_info_dict = {
'queryset':Noticia.objects.all(),
'date_field':'pub_date',
}
urlpatterns = patterns('django.views.generic.date_based',
(r'^$','archive_index', noticias_info_dict,'noticias_archive_index'),
(r'^(?P<year>\d{4})/$','archive_year', noticias_info_dict,'noticias_archive_year'),
(r'^(?P<year>\d{4})/(?P<month>\w{3})/$','archive_month', noticias_info_dict,'noticias_archive_month'),
(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/$','archive_day', noticias_info_dict,'noticias_archive_day'),
(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$','object_detail', noticias_info_dict,'noticias_archive_detail'),
)
Thanks guys :)