multiple lookups for date fields

2009-05-05 Thread shadfc
Hey everyone, I came across the need today to use something like MyModel.objects.filter(date__month__gte=9). However, that doesn't work: >>> ContactEvent.objects.filter(date__month__gte=9) Traceback (most recent call last): File "", line 1, in File "/usr/local/share/djangos/django-trunk/d

Altering data uploaded to FileField before save is called

2008-09-10 Thread shadfc
My use case is this: I'm using a custom filestorage backend to Amazon S3. An inline model allows the upload of mp3 files and I am trying to edit the ID3 tag on these before they get saved to backend. To accomplish this, I've overridden the save_formset() on the parent ModelAdmin to do a save(co

Initial values for ModelForms with additional fields

2008-04-18 Thread shadfc
I posed this question on IRC and was told to direct it here because it might be "interesting". I created a ModelForm with additional fields which aren't present on the model. Now, I want to use this form to edit an instance of the model, but there doesn't seem to be a way set the additional fiel