`unique_together` is a database level feature so it cannot depend on
web-server and its modules.
When you don't give any code to see where you add new entry and
retrieve.

On Jun 29, 10:32 am, Julien <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Since I switched my site from mod_python to mod_wsgi, the meta
> attribute 'unique_together' stopped working properly. When creating a
> duplicate entry, instead of getting the error message "Entry with this
> date already exists for the given slug." I get an exception:
>
> "MultipleObjectsReturned: get() returned more than one Entry-- it
> returned 2! Lookup parameters were {'date__iexact': u'2008-06-04',
> 'slug__iexact': u'example-title'}"
>
> (Full traceback given below.)
>
> Also, some duplicates have slipped through when entries have been
> added by the administrators of the site. So, apparently, that
> exception is not always raised or at least it fails silently.
>
> It works fine on the development server which runs with mod_python....
>
> Has someone got similar issues, and would you see what I'm missing
> here?
>
> Thanks a lot!
>
> Julien
>
> PS: Traceback:
>
>  File "/MY_PATH/django/core/handlers/base.py", line 82, in
> get_response
>    response = callback(request, *callback_args, **callback_kwargs)
>
>  File "/MY_PATH/django/contrib/admin/views/decorators.py", line 62, in
> _checklogin
>    return view_func(request, *args, **kwargs)
>
>  File "/MY_PATH/django/views/decorators/cache.py", line 44, in
> _wrapped_view_func
>    response = view_func(request, *args, **kwargs)
>
>  File "/MY_PATH/django/contrib/admin/views/main.py", line 334, in
> change_stage
>    errors = manipulator.get_validation_errors(new_data)
>
>  File "/MY_PATH/django/oldforms/__init__.py", line 62, in
> get_validation_errors
>    errors.update(field.get_validation_errors(new_data))
>
>  File "/MY_PATH/django/oldforms/__init__.py", line 379, in
> get_validation_errors
>    self.run_validator(new_data, validator)
>
>  File "/MY_PATH/django/oldforms/__init__.py", line 369, in
> run_validator
>    validator(new_data.get(self.field_name, ''), new_data)
>
>  File "/MY_PATH/django/utils/functional.py", line 55, in _curried
>    return _curried_func(*(args+moreargs), **dict(kwargs,
> **morekwargs))
>
>  File "/MY_PATH/django/db/models/manipulators.py", line 302, in
> manipulator_validator_unique_together
>    old_obj = self.manager.get(**kwargs)
>
>  File "/MY_PATH/django/db/models/manager.py", line 82, in get
>    return self.get_query_set().get(*args, **kwargs)
>
>  File "/MY_PATH/django/db/models/query.py", line 199, in get
>    % (self.model._meta.object_name, num, kwargs))
>
> MultipleObjectsReturned: get() returned more than one Entry-- it
> returned 2! Lookup parameters were {'date__iexact': u'2008-06-04',
> 'slug__iexact': u'example-title'}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to