Invalid syntax when place QuerySet to a new value

2009-07-02 Thread Xuqing Kuang
Hi, all. I want to generate a report of my job status in somedays, so I make a QuerySet like following: # Generate query set jobs = Job.list(request.REQUEST) #today_jobs = jobs.filter(started_time__gte = date.fromtimestamp (time.time())) 7days_jobs = jobs.fi

Re: Invalid syntax when place QuerySet to a new value

2009-07-02 Thread Xuqing Kuang
Ahhh!!! Thank you for you resolved my problem !!! On Jul 3, 11:46 am, Alex Gaynor wrote: > On Thu, Jul 2, 2009 at 10:43 PM, Xuqing Kuang wrote: > > > Hi, all. > > > I want to generate a report of my job status in somedays, so I make a > &

Can't query records with my custom list order.

2009-05-08 Thread Xuqing Kuang
First define some list contain random values such as: >>> foo_list = (3, 4, 5, 2) Then use QuerySet to query the list in a table, but it returns objects will increase id value. >>> foo = Foo.objects.filter(id__in = foo_list) Actually result: >>> print foo.values [{'id': 2}, {'id': 3}, {'id': 4

How to set attribute to the items in a QuerySet.

2009-12-14 Thread Xuqing Kuang
Hi, all. Are there any way could keep a attribute new set to a item in QuerySet object ? For example: >>> tcs = TestCase.objects.filter(case_id__in = [1123, 1124, 1125]) >>> tcs [, , ] >>> tc = tcs[1] >>> setattr(tc, 'selected_param', []) >>> tc.selected_param [] >>> tcs[1].selected_param Traceb

Re: How to set attribute to the items in a QuerySet.

2009-12-16 Thread Xuqing Kuang
Good idea. Thank you very much :-) Xuqing On Dec 15, 7:19 pm, Daniel Roseman wrote: > On Dec 15, 7:02 am, Xuqing Kuang wrote: > > > > > Hi, all. > > > Are there any way could keep a attribute new set to a item in QuerySet > > object ? > > > For exampl

Creating many-to-many tables for auth.Group model two times cause traceback in syncdb.

2010-05-24 Thread Xuqing Kuang
Hi. all. I got a strange problem when syncdb. The syncdb output just like following, as you can see the auth_group_permissions table create 2 times. It break unit testing with './manage.py test' process. The thing happens both mysql and sqlite3 backend. And I check the models.py code in testre

Re: Django 1.5 - Session request.session.set_expiry() raised 500 with datetime object.

2013-06-10 Thread Xuqing Kuang
Ok, thank you very much for your reply. I will have a try later, and it should noticed in the doc maybe better. ;-) — Sent from Mailbox for iPhone On Mon, Jun 10, 2013 at 4:40 PM, Tom Evans wrote: > On Sun, Jun 9, 2013 at 5:07 AM, XQ Kuang wrote: >> Hi. >> >> The form of my app posted the ex