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

2008-04-24 Thread Phil Davis
2008/4/24 Phil Davis <[EMAIL PROTECTED]>: > 2008/4/24 Raisins <[EMAIL PROTECTED]>: > [...] > {% for x in form %} > {{x.item.some_x_attr}} > {{x}} > {% endfor %} > I forgot that within the template there is a BoundField wrapper around each real form fie

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

2008-04-24 Thread Phil Davis
2008/4/24 Raisins <[EMAIL PROTECTED]>: > > I have moved along some more. Now Using this snippet ( > http://www.djangosnippets.org/snippets/148/ ) > > z = FOO.objects.get(id=pram_id) > y = z.BAR.filter(off = False) > #. > form_dict = {} > for x in y: > form_dict[x.id] = forms.Boo

Re: Custom form field overrides model attributes?

2008-04-20 Thread Phil Davis
super(EventForm, , self).__init__(*args, **kwargs) self.fields['endDate'].widget = DateTimeWidget() class Meta: model = Event -- Phil Davis --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: ModelForm, Foreign key and blank value in choices

2008-04-18 Thread Phil Davis
s['object_category'].widget = > forms.RadioSelect(choices=[(c.id, c) for c in > self.fields['object_category'].queryset]) There is an empty_label kwarg you can set to None to supress the "-" option so I guess something like: self.fields['object_ca

Re: PostreSQL "psql" problem

2008-04-18 Thread Phil Davis
k a shell prompt so the other commands will actually be run. Running postgres by hand like this is fairly unusual. Normally it would be started/stopped by the main init scripts which is a far more reliable way. -- Phil Davis --~--~-~--~~~---~--~~ You received this m

Re: Tricky newforms problem

2008-04-11 Thread Phil Davis
ld' is actually a boundfield instance which wraps the real field. To get to the real field use 'field.field' in the template. I.e. your template would look like: {% for field in form %} {% if field.field.is_song %} ... -- Phil Davis --~--~-~--~~

Re: Adding additional needed information in to newforms post

2008-04-01 Thread Phil Davis
On 01/04/2008, timc3 <[EMAIL PROTECTED]> wrote: > I thought that I could add in some additional information to a form > before it gets saved as a new object in the database but the following > isn't working: > > def groupadd(request): > > if request.method == 'POST': > form = Group

Re: Moving active site from 0.96 to current svn

2008-02-24 Thread Phil Davis
On 24/02/2008, richard <[EMAIL PROTECTED]> wrote: > > I'd like to migrate a biggish mission critical 0.96 django powered > site to a recent development version so my ongoing work harnesses > newer goodies, in particular newer new forms. To do this I need to > assess how much of my code will br

Re: accessing verbose_name and other field meta data

2007-10-26 Thread Phil Davis
ns this very case. The answer is use {{form.FIELDNAME.label_tag}} in your template. Cheers, -- Phil Davis --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-

Re: Label and input Filed overlap

2007-10-11 Thread Phil Davis
from which CSS style line and even change it in the browser to test out what effect any change would have. http://www.getfirebug.com/ Cheers, -- Phil Davis --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: Label and input Filed overlap

2007-10-11 Thread Phil Davis
at the admin app uses (django/contrib/admin/media/css/forms.css) so one way to fix your problem would be to edit that file or include your own style sheet after the forms.css which overrode the label element's width. Cheers, -- Phil Davis --~--~-~--~~~---~--

Re: Confusion over CRUD generic views and newforms

2007-07-29 Thread Phil Davis
On 26/07/07, Matt <[EMAIL PROTECTED]> wrote: > Can you confirm that the CRUD generic views are compatible with > newforms? I haven't seen any examples of how to do it, but I'm having > a hard time believing that this core functionality hasn't been > implemented (or even patched) for newforms yet.

Re: sleep for 30 minutes?

2007-06-10 Thread Phil Davis
On 10/06/07, MartinWinkler <[EMAIL PROTECTED]> wrote: > > Hi all, > > I have implemented a captcha solution for django (because the already > available approaches did not fit my needs), and came to this problem: > > An image is created for every captcha-enabled form that is being > displayed. Wen

Re: How to render newforms dynamically created fields?

2007-04-30 Thread Phil Davis
On 30/04/07, Mario Graziosi <[EMAIL PROTECTED]> wrote: > > I have a form with several checkboxes created dynamically, where each > field has a name similar to "mycheck_xxx". From within the template I > don't know how many checks the form holds, since these are built > dynamically. How can I rende

Re: DateField returns 'str' object has no attribute 'strftime'

2007-04-30 Thread Phil Davis
On 30/04/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > [...] > Same problem: > AttributeError at /telecom/conference/detail/9/ > 'tuple' object has no attribute 'strftime' > > This happens on update of newform. What am I doing wrong? > > view code: > - [...] > conf.co

Re: temp tables

2007-04-17 Thread Phil Davis
On 16/04/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: [...] > After they are displayed...they can be nuked...but the guy working on > this piece told me he couldn't get the temp table to stick around long > enough with the django connection to be able to get the results back > because I believ

Re: models, composite primary keys

2007-01-30 Thread Phil Davis
On 1/27/07, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> wrote: > Does anyone worked on some way to django models work with composite > primary keys? I need to implement a login system and the login should > be unique for an specified username and a specified site url. I see the > ticket above and it

Re: generic list view question

2006-12-18 Thread Phil Davis
i/ExprTag I think you would need to pass last_seen in via extra_context and do: {% expr object.topic_modification_date > last_seen as newflag %} {% if newflag %} NEW! {% endif %} Cheers, -- Phil Davis --~--~-~--~~~---~--~~ You received this message because you

Re: generic list view question

2006-12-17 Thread Phil Davis
{{post.post_set.all.-5.post_text}} directly in the template (untested)? -- Phil Davis --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegro

Re: extracting field information from models

2006-12-16 Thread Phil Davis
'value':f.__getattribute__(f._meta.fields[0].attname) > } > ) Try: app_fields = [] for f in app._meta.fields: app_fields.append( { 'label' : f.verbose_name, 'value': getattr(app, f.name), } Works for me on Boolean field

Re: Re: edit_inline behavior

2006-11-09 Thread Phil Davis
On 11/9/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On 11/9/06, Phil Davis <[EMAIL PROTECTED]> wrote: [...] > > I have just tried a 'by-the-docs' generic view with simple 2 model > > master/detail update form and get exactly the same problem

Re: edit_inline behavior

2006-11-09 Thread Phil Davis
list of > participants doubles! Did you ever find out the answer to this problem? I have just tried a 'by-the-docs' generic view with simple 2 model master/detail update form and get exactly the same problem or duplicated detail rows after each save. -- Phil Davis --~--~-~--~