pascut.com now has a new design and a new engine. It still uses Python, Django and Webfaction, but I changed the blog app from Diario to Zinnia.
It was lots of fun developing again with Django and Python...
pascut.com now has a new design and a new engine. It still uses Python, Django and Webfaction, but I changed the blog app from Diario to Zinnia.
It was lots of fun developing again with Django and Python...
In certain cases the Django generic views will behave like they are caching data. They are doing that for the queryset argument and not for extra_context which is known to be cached. This will happen if you send to the generic view a queryset filtered with a callable.
Let's take as an example a blogging application. In blog.models we have:
class PublishedManager(Manager):
def get_query_set(self):
queryset = super(PublishedManager, self).get_query_set()
return queryset.filter(pub_date__lte=datetime.now)
class Entry(models.Model):
...
pub_date = models.DateTimeField()
published = PublishedManager()
...
In blog.urls:
info_dict = {'queryset': Entry.published.all()}
entry_list = url( regex = '^$',
view ...