Re: moving to django 1.2.1
One issue that bit me that has also been mentioned here in other threads: errors that were previously caught are now raised as errors. So technically it was wrong previously but functionally it only breaks on 1.2. I haven't found a good explanation / summary of what/why/ which errors it now affects. Mine was a circular import error that I had to track down. Important to note -- the error only showed up when the app ran via wsgi or when I did an import main in the py shell, it did not throw an error in the dev server!! So do your upgrade testing accordingly. Good luck! D On Jul 28, 10:03 am, Massimiliano Ravelli wrote: > On 28 Lug, 15:44, knight wrote: > > > Does anybody knows a good post or blog about the changes including > > csrf? > > I forgot to suggest > readinghttp://docs.djangoproject.com/en/dev/releases/1.2/#backwards-incompat... -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
custom validation for an inline formset, howto?
I am trying to perform custom validation on an inline formset. The docs indicate that custom formset validation should go through a custom clean method: http://docs.djangoproject.com/en/1.1/topics/forms/formsets/#custom-formset-validation but the clean method doesn't get called for my instance of an inline formset when I call is_valid() on the formset. Conceptually, I have Client model with many PhoneNumber models for my inline formset, and want to do some validation on the phone number fields based on fields in client. The relevant code snippets for my project: custom form code: class BaseClientPhoneInlineFormSet(BaseInlineFormSet): # do nothing pass-through method, but see that logging statement prints def __init__(self, data=None, files=None, instance=None, save_as_new=False, prefix=None): logging.debug("IN client.forms.BaseClientPhoneFormset.__init__") super(BaseClientPhoneInlineFormSet, self).__init__(data, files, instance, save_as_new, prefix) # this should do validation, but doesnt. this logging statement never prints def clean(self): logging.debug("IN client.forms.BaseClientPhoneFormset.clean") super(BaseClientPhoneInlineFormSet, self).clean() raise forms.ValidationError("Test Inline Formset Clean Fail.") view code: ClientPhoneFormSet = inlineformset_factory(models.Client, models.PhoneNumber, formset=BaseClientPhoneInlineFormSet) formset = ClientPhoneFormSet(request.POST, instance=client_ref) formset.is_valid(): # no validation error thrown, returns true The __init__ logging message is output, but the clean logging message is not, and no ValidationError is thown on is_valid(). I've searched and not found any similar questions which makes me think I'm missing something obvious :-/ Thanks for any help. dan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Debugging Django project using Eclipse (Apache + mod_wsgi)
this is a good place to get started: http://code.google.com/p/modwsgi/wiki/DebuggingTechniques On Mar 16, 10:11 am, Stefan wrote: > Hello, > > When i used Django web-server there were no problems with debugging > Django projects in Eclipse IDE. > I had to deploy it on Apache web server. > > How can i debug the same project if it is deployed on Apache with > module mod_wsgi? > > With regards, Stefan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
getting _collect_sub_objects() error during delete if a foriegn key's foreign key is null
Trying to delete objects from the django admin or app code, I'm getting an error: File "/home/styleseat/ssenv/lib/python2.6/site-packages/django/db/ models/base.py", line 595, in _collect_sub_objects sub_obj._collect_sub_objects(seen_objs, self, related.field.null) AttributeError: ‘NoneType’ object has no attribute ‘_collect_sub_objects’ I'm using django 1.2.1 final I think its easiest to decribe the models rather than post: I'm trying to delete a Pro object. Related models: we have GalleryImage objects, GalleryImage extends Image, GalleryImage has a FKs (null=True, blank=True) to Pro and to a Location object If the Pro has any GallleryImage objects with a null Location the error is thrown. If I assign a Location object to the GalleryImage then the Pro will delete, along with the GalleryImage objects and the Location object. Any thoughts? I can put together a simple test case and post a bug and/or work on a patch, but maybe its already been addressed in 1.3 Stack trace: File "/home/styleseat/ssenv/lib/python2.6/site-packages/django/contrib/ admin/options.py", line 1167, in delete_view (deleted_objects, perms_needed) = get_deleted_objects((obj,), opts, request.user, self.admin_site) File "/home/styleseat/ssenv/lib/python2.6/site-packages/django/contrib/ admin/util.py", line 111, in get_deleted_objects obj._collect_sub_objects(collector) File "/home/styleseat/ssenv/lib/python2.6/site-packages/django/db/ models/base.py", line 613, in _collect_sub_objects sub_obj._collect_sub_objects(seen_objs, self, related.field.null) File "/home/styleseat/ssenv/lib/python2.6/site-packages/django/db/ models/base.py", line 595, in _collect_sub_objects sub_obj._collect_sub_objects(seen_objs, self, related.field.null) AttributeError: ‘NoneType’ object has no attribute ‘_collect_sub_objects’ -- 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@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.