Jul 252009

keyword_results=Card.objects.filter(searchkeyword__keyword__in=query.split()).distinct()
if keyword_results.count() == 1:
return HttpResponsRedirect(keyword_results[0].get_absolute_url())
————
results of database queries is special object called
QuerySet
is the class Django uses to represent a database query.
Each QuerySet has methods such as,
filter()
distinct()
count()
etc.

Posted by weboom at 1:30 pm Tagged with: , , , , ,
Jun 262009

At settings.py
DATABASE_ENGINE = ’sqlite3′
DATABASE_NAME = ‘myblogsite.db’

Posted by weboom at 6:56 am Tagged with: ,
Switch to our mobile site
Top Footer