Re: ModelForms and the Rails input handling vulnerability

2012-06-12 Thread Gary Reynolds
On 13 June 2012 09:16, Luke Plant wrote: > = Option 2: Deprecate Meta.exclude, but still allow a missing > Meta.fields attribute to indicate that all fields should be editable. > > The policy here is essentially this: if any fields the model are > sensitive, assume all are potentially, and requir

Re: Make "required=True" on forms.fields.NullBooleanField do something useful?

2010-08-04 Thread Gary Reynolds
Sorry this is quite late on this thread, but I hadn't noticed any answer for it. How about: from django import forms class MyNullBooleanField(forms.NullBooleanField): def clean(self, value): if value is None: raise forms.ValidationError('Choose either Yes or No.')

Re: Re: Default ordering on User model

2010-05-24 Thread Gary Reynolds
You could always use a proxy model instead of monkey patching. class MyUser(User): class Meta: proxy = True ordering = ('first_name', 'last_name') def __unicode__(self): return self.get_full_name() Then in any models you define a FK to User, just FK to MyUser instead. On Fri, May

Re: dbsettings, and user configurable app settings

2010-03-10 Thread Gary Reynolds
I really don't see how your YAML file is any more maintainable than Django's settings.py approach? If anything, I would argue that it is less maintainable, as you would have to maintain not only your YAML files moving forward, but also the code which transposes it into a settings.py. On Wed, Mar 1

Re: Django documentation for newer users

2010-03-05 Thread Gary Reynolds
That's interesting, I'm of the other belief... I find the Django documentation to be thorough and organised very well. One of the main reasons I (and I am sure countless others) even started using Django was because of it's excellent documentation. As the project has matured from version 0.96 onw

Re: Serialization of single object instead of only querysets.

2010-02-15 Thread Gary Reynolds
There is already a ticket for this (and possibly others). http://code.djangoproject.com/ticket/11244#comment:4 It has been closed and marked wontfix, see the comments for why. On 15 Feb 2010, at 21:53, orokusaki wrote: Please visit the following URL, and when you do, put your focus into the

Re: #12801 : Allow empty non-nullable ForeignKey fields until save()

2010-02-12 Thread Gary Reynolds
> > The correct exception is risen when you try to save it: > > >>> t.save() > Traceback (most recent call last): > ... > IntegrityError: 20100212_thing.owner_id may not be NULL > > How can you not understand that the DoesNotExist exception above is > risen too early? It is a bug! > Are you sa

Re: user_passes_test decorator changes in 1.2

2010-01-07 Thread Gary Reynolds
> > Yes, that definitely falls into the category of relying on an > implementation detail, rather than something that should be mentioned > as a backwards incompatibility. At the level of inspecting code > objects (which is essentially what your code was doing), almost any > change is backwards in