Re: Unit test example for web froms

2012-02-12 Thread veearrsix
Coming from a non python/django background (my experience is groovy/ grails), but when we test our controllers (I think this is equivalent to django views). We simply set up mock params on the request and set expectations on the controller properties. Simple example: given: request.params = [

Re: single queryset from multiple tables

2009-04-15 Thread veearrsix
Thanks guys that was perfect On Apr 14, 3:53 pm, Alex Gaynor wrote: > On Tue, Apr 14, 2009 at 10:50 AM, veearrsix wrote: > > > Thanks for the help so far guys, I've used that recipe suggested by > > Malcolm, where by I pass a number of querysets into the method. It

Re: single queryset from multiple tables

2009-04-14 Thread veearrsix
Thanks for the help so far guys, I've used that recipe suggested by Malcolm, where by I pass a number of querysets into the method. It works as expected I guess, BUT, I would like to be able to sort by the datetime field from each queryset, however the fieldnames for each of the date time fields f

single queryset from multiple tables

2009-04-10 Thread veearrsix
This question seems to have been asked a few times, but never answered fully. I am looking to query more than one table, but return the results to a template as one queryset ordered by date. The reason i'm doing this is to create a single queryset including information from a blog table, twitter

Latest comments

2008-06-14 Thread veearrsix
Hi, I'm trying to list latest comments using the comments contrib in my django app, I would like to list both comments from users who are staff ('is_staff' in the auth_user table), and comments from users who are NOT staff members. My question is, how do I create 2 lists, 1 with the comments fro

Re: advice on table joins

2008-01-28 Thread veearrsix
I too am having trouble with querying across multiple tables. my (simplified) models:- class Channel(models.Model):#blog name = models.CharField("Name", maxlength=30) slug = models.SlugField("URL", prepopulate_from=('name',)) class Admin: pass de

'sites' framework

2007-11-27 Thread veearrsix
I've recently added the sites framework but i'm noticing that the SITE_ID (settings.SITE_ID), is returning an id of a site that doesn't exist. I'm running on the development server @127.0.0.1:8000, this obviously doesn't relate to any of the sites that I have added within the sites table. It is a