Re: Using a variable for a field name in a filter?

2010-05-15 Thread chewynougat
Sorry, didn't initially see the replies, repeating the answer to Javier and Nuno! On May 15, 10:09 am, chewynougat wrote: > Hi Derek, > > If I am thinking correctly, you can build up a list of keyword > arguments in a dictionary for a filter query (or any query). > > So

Re: Using a variable for a field name in a filter?

2010-05-15 Thread chewynougat
Hi Derek, If I am thinking correctly, you can build up a list of keyword arguments in a dictionary for a filter query (or any query). So, for example, in a for loop: first time round: kwargs = {'foo': 'found'} where the key is the database field and the value is the record(s) you are searching f

Re: Checkboxes checked when editing a form

2009-11-04 Thread chewynougat
, Daniel Roseman wrote: > On Nov 4, 3:58 pm, chewynougat wrote: > > > > > Hi > > > When I want a user to edit a form, I would like previously checked > > checkboxes to show as checked. However, they are not showing (just > > unchecked checkboxes). Can anyone

Checkboxes checked when editing a form

2009-11-04 Thread chewynougat
Hi When I want a user to edit a form, I would like previously checked checkboxes to show as checked. However, they are not showing (just unchecked checkboxes). Can anyone explain to me why this is? Model: class GroupOption(models.Model): group = models.ForeignKey(Group) media =

Re: IndexError when creating a formset

2009-09-10 Thread chewynougat
ed to be set to u'' in order for new ones to be created that were associated with the new object...if that makes sense! Thanks anyway :) On Sep 9, 2:53 pm, chewynougat wrote: > Hi, > > I have instances in my code where I need to save an object with a new > pk. Then I need t

IndexError when creating a formset

2009-09-09 Thread chewynougat
Hi, I have instances in my code where I need to save an object with a new pk. Then I need to create and save an inline formset using the newly created object as the instance. form_instance = form.save(commit=False) form_instance.pk = None form_instance.slug = None form_instance.save() CardioFor

Re: inlineformsets version 1.0.2

2009-04-20 Thread chewynougat
Good stuff, thanks for the reply all. Roll on 1.0.3! On Apr 20, 4:19 pm, Karen Tracey wrote: > On Mon, Apr 20, 2009 at 11:03 AM, Alex Gaynor wrote: > > On Mon, Apr 20, 2009 at 7:18 AM, chewynougat < > > peter_i_campb...@hotmail.co.uk> wrote: > > >> We have rece

inlineformsets version 1.0.2

2009-04-20 Thread chewynougat
We have recently upgraded django to 1.0.2 but this has subsequently broken some inlineformsets we have. I'm not sure if this is a django bug or if it is an error in our code, although the code pretty much reflects that in the SVN documentation. Any help on this issue would be much appreciated, in

Re: Splitting a NullBooleanField in a template

2009-01-27 Thread chewynougat
 pm, chewynougat wrote: > I am using a NullBooleanField called bequeath in a form wizard with a > RadioSelect widget with two choices. I would like to place the two > radio buttons in a customised layout in the template but do not know > how. > > Currently, I can only layout the bu

Re: Splitting a NullBooleanField in a template

2009-01-27 Thread chewynougat
 pm, chewynougat wrote: > I am using a NullBooleanField called bequeath in a form wizard with a > RadioSelect widget with two choices. I would like to place the two > radio buttons in a customised layout in the template but do not know > how. > > Currently, I can only layout the bu

Re: Splitting a NullBooleanField in a template

2009-01-27 Thread chewynougat
 pm, chewynougat wrote: > I am using a NullBooleanField called bequeath in a form wizard with a > RadioSelect widget with two choices. I would like to place the two > radio buttons in a customised layout in the template but do not know > how. > > Currently, I can only layout the bu

Splitting a NullBooleanField in a template

2009-01-27 Thread chewynougat
I am using a NullBooleanField called bequeath in a form wizard with a RadioSelect widget with two choices. I would like to place the two radio buttons in a customised layout in the template but do not know how. Currently, I can only layout the buttons next to each other by writing: form.bequeath

User in form wizard

2008-12-08 Thread chewynougat
Could anyone tell me if I can pass the current user to a form wizard step so I can prepopulate their object details in the form? If so, how? Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

modelform_sets

2008-09-04 Thread chewynougat
I am attempting to use modelform_sets and AFAIK I have implemented it correctly. The problem is that the first time the form is submitted without any data in the form fields, the is_valid() function validates these fields as being valid and then stores empty values in the database, even though my

Foreign key on forms

2008-08-25 Thread chewynougat
Hi, I need to display a form such that the foreign key fields are displayed exactly like that in djangoproject.com/documentation/ tutorial02, where up to 3 entries can be made using the fk fields. It would be nice to have the same functionality provided in this tutorial for normal forms, not just

Re: Changing the returned query set in the admin interface 'add' section depending on user permissions.

2008-08-20 Thread chewynougat
; in it's architecture.  Sorry, not sure where to point you other than > that. > > John > > On Aug 19, 4:19 am, chewynougat <[EMAIL PROTECTED]> > wrote: > > > Hi, > > > I have an admin add form that allows users to insert documents. I have > >

Changing the returned query set in the admin interface 'add' section depending on user permissions.

2008-08-19 Thread chewynougat
Hi, I have an admin add form that allows users to insert documents. I have a select box which currently displays all company departments and their relevant categories (e.g. finance and admin -> payroll, finance and admin -> expenses etc). What I would like to do is display the relevant department