Re: Keeping order with order_by while using id__in

2008-12-21 Thread Raisins
Thanks for the in depth feedback about what is going on with the order. Also thanks for the code snippet. I ended up doing something very similar. On Dec 21, 8:16 pm, Malcolm Tredinnick wrote: > On Sun, 2008-12-21 at 08:58 -0800, Raisins wrote: > > i = [ 1, 5,2,6] > > Model

Keeping order with order_by while using id__in

2008-12-21 Thread Raisins
i = [ 1, 5,2,6] Model.objects.filter(id__in = i) This currently will order them by id, even if i call order_by() with no parameters. The docs say "If you don't want any ordering to be applied to a query, not even the default ordering, call order_by() with no parameters." Is there a way to main

Re: refence a variable in a template in side another variable

2008-04-24 Thread Raisins
Awesome, this worked perfectly. I completely forgot about custom template tags. I can now build the form dynamically and display any info from the object. On Apr 24, 1:51 pm, "Phil Davis" <[EMAIL PROTECTED]> wrote: > 2008/4/24Raisins<[EMAIL PROTECTED]>: > > > > If you really want to do it you can

refence a variable in a template in side another variable

2008-04-24 Thread Raisins
On Apr 21, 9:12 am, Raisins <[EMAIL PROTECTED]> wrote: > I have it implemented without new forms for now. Anyone have an idea > how I could do it with new forms? > > On Apr 18, 5:11 pm,Raisins<[EMAIL PROTECTED]> wrote: > > > I am trying to cr

Re: A dynamic MultipleChoiceField with m2m and each option be one of those objects

2008-04-21 Thread Raisins
I have it implemented without new forms for now. Anyone have an idea how I could do it with new forms? On Apr 18, 5:11 pm, Raisins <[EMAIL PROTECTED]> wrote: > I am trying to create a dymanic MultipleChoiceField with the > CheckboxSelectMultiple widget. The thing I want different

Re: A dynamic MultipleChoiceField with m2m and each option be one of those objects

2008-04-21 Thread Raisins
advantage of it. Anyone have an idea how I could? On Apr 18, 5:11 pm, Raisins <[EMAIL PROTECTED]> wrote: > I am trying to create a dymanic MultipleChoiceField with the > CheckboxSelectMultiple widget. The thing I want different, is the all > the list for the Choice field I want to b

Re: Displaying user names on all pages

2008-04-19 Thread Raisins
Add context_instance=RequestContext(request) to your render_to_response for your views render_to_response('mainpage.html', {'stuff' : stuf }, context_instance=RequestContext(request)) On Apr 19, 1:36 pm, chiefmoamba <[EMAIL PROTECTED]> wrote: > Hello, > > I am hoping this will be a very simple q

A dynamic MultipleChoiceField with m2m and each option be one of those objects

2008-04-18 Thread Raisins
I am trying to create a dymanic MultipleChoiceField with the CheckboxSelectMultiple widget. The thing I want different, is the all the list for the Choice field I want to be references to that object. c = Model1.objects.get(id=temp_id) i = [ ['-','-']] for x in c.m2mModel2.all(): i.append

Re: datetime.date.today()

2008-03-06 Thread Raisins
date needs to be a DateTimeField, and you can also use the built in auto_now_add date = models.DateTimeField(auto_now_add = True) On Mar 6, 5:05 pm, DuncanM <[EMAIL PROTECTED]> wrote: > I want to create a model that doesn't ask for the users input on the > date, it takes the days date automatica

Re: learning django and python

2007-11-13 Thread Raisins
I love Instantd Django. I made installing and depolying django and python a breeze also I can move from my work to home every easy just by carrying around my thumbdrive. I highly suggest it to anyone on the fence about either Python or django. I haven't found an easier cleaner way to deploy them a