URLPatterns and QueryStrings

2009-06-07 Thread thedevilsprogram...@gmail.com
I wish to use a QueryString on my search page like so /search?s=jupiter&page=2 So I have set up a single url pattern (r'^search/$', 'mything.myapp.views.search_page.search_page'), And I am then able to grab the parameters in my view, like so - def search_page(request, search="", p

Re: handling object hierarchies in templates

2009-01-22 Thread thedevilsprogram...@gmail.com
Oh, and my model class Category(models.Model): parent = models.ForeignKey('self', null=True) slug = models.SlugField() title = models.CharField(max_length=50) def __unicode__(self): return self.title --~--~-~--~~~---~-

handling object hierarchies in templates

2009-01-22 Thread thedevilsprogram...@gmail.com
Lets say I have a bunch of categories which can optionally contain subcategories... What would be the ideal way to go about a) preparing this data for my templates, and b) displaying this data in m templates Here is what I currently have.. it feels dirty -