Re: DRY violation using get_or_create with defaults

2012-06-12 Thread Jerome Baum
On 12 Jun 2012, at 10:44, Gelonida N wrote: > On 06/12/2012 05:44 AM, Jerome Baum wrote: >> Drop the "defaults" kwarg to get_or_create as apparently you're not >> using it. Also drop the conditional on those set/save statements. >> >> > > Wouldn&

Re: DRY violation using get_or_create with defaults

2012-06-11 Thread Jerome Baum
Drop the "defaults" kwarg to get_or_create as apparently you're not using it. Also drop the conditional on those set/save statements. On Monday, June 11, 2012 3:44:47 PM UTC+2, ojno wrote: > > Hi all, > > In my app, which involves doing background tasks and possibly rerunning > them a number of

Re: Does adding editable=False to model require a data migration?

2012-04-28 Thread Jerome Baum
On Apr 27, 7:34 pm, Micky Hulse wrote: > From the docs: > > editable > Field.editable > If False, the field will not be editable in the admin or via forms > automatically generated from the model class. Default is True. > > So, it reads like I can add the editable argument to the field without > h

Re: Django code patterns

2012-02-09 Thread Jerome Baum
On Feb 9, 9:41 am, Rune Kaagaard wrote: >         has_changed = False >         if resource.user.email != request.POST['email']: >             resource.user.email = request.POST['email'] >             has_changed = True >         if resource.user.is_active != request.POST['is_active']: >          

django-digested 0.1.2

2012-02-09 Thread Jerome Baum
I hope here's the right place to announce this: I've just released the [django-digested][1] package to PyPI. It supports instant notifications, daily and weekly digests, and individual preferences for different groups of updates. The package handles the "digest" part of your notifications. For ea