Handling legacy single-row tables

2007-10-24 Thread Bill Fenner
I've got a legacy application with a few tables that only have a single row, e.g., for configuration information. I can easily get the info with the following hack: pick a column to be a pretend primary key (so that django doesn't add the id field), and use Model.objects.get(foo__isnull=False) -

Re: Regstration module "lost password"

2007-10-09 Thread Bill Fenner
On 10/9/07, James Bennett <[EMAIL PROTECTED]> wrote: > Plus, he alternative is to either store plaintext passwords or provide > a way to recover plaintext passwords, both of which are not going to > happen in any way, shape or form, because they *do* present extremely > serious security problems.

Re: Regstration module "lost password"

2007-10-08 Thread Bill Fenner
On 10/8/07, James Bennett <[EMAIL PROTECTED]> wrote: > In the default setup, the URL /accounts/password/reset/ will, provided > the user inputs their email address correctly, send out a a new > password. Which is an excellent way to partially lock someone out of the site, by preemptively changing

Re: queryset cache

2007-08-23 Thread Bill Fenner
On 8/22/07, sean <[EMAIL PROTECTED]> wrote: > for i in requested_forms: > form=mediaform(data, auto_id="some_generated_id") > # assign the queryset to the choices > form.base_fields['somefield'].queryset = qs Try adding: form.base_fields['somefield'].widget.choices = form.base_

Re: Building forms by hands

2007-07-07 Thread Bill Fenner
On 7/7/07, Alexander Solovyov <[EMAIL PROTECTED]> wrote: > Mmm... I'm using form_for_instance-derived form with many > modifications (Indeed, this is better than using form, written by > hands) - I love automatization. But my colleguaes, who are responsible > for HTML part, doesn't like django-gen

Re: how I can get the proper get_absolute_url?

2007-06-30 Thread Bill Fenner
On 6/30/07, Young Gyu Park <[EMAIL PROTECTED]> wrote: > > class Author(models.Model): > > user = models.ForeignKey(User,related_name='authors') > > class Blog(models.Model): > > author = models.ForeignKey(Author,related_name='blogs') > > class Entry(models.Model): > > blog = models.For

Re: How do you get at a RadioFieldRenderer object from a template? (newforms)

2007-05-07 Thread Bill Fenner
I did this with an accessor function in the form class: class NonWgStep1(forms.Form): add_edit = forms.ChoiceField(choices=( ('add', 'Add a new entry'), ('edit', 'Modify an existing entry'), ('delete', 'Delete an existing entry'), ), widget=forms.RadioSelect)