-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError when using hstore.DictionaryField in a unique_together clause #44
Comments
Ooops, missed a bit:
|
could you show the code that causes the exception? |
In my case, it's a model like this: class Action(models.Model):
description = models.CharField(
max_length = 255,
)
type = models.PositiveSmallIntegerField(
choices = TYPE_CHOICES,
)
qualifiers = hstore.DictionaryField(
blank = True,
)
def __unicode__(self):
return self.description
class Meta:
ordering = ("type", "description",)
unique_together = (
# Cannot use this yet, due to https://github.com/djangonauts/django-hstore/issues/44
# ("type", "qualifiers",),
) The issue appears to occur during model validation in the admin add_view. |
thanks, will look into it asap |
Hi! I have tested in in an isolated environment with same model configuration and with both django versions (1.6 and 1.7) with python3 and python2 and I can not reproduce the error. This happens when you run syncdb, I'm right? |
Nope. It happens when the app serves it's first request, and only occurs intermittently. If the problem occurs, then the app remains broken with this error until manually restarted. A restart usually fixes it, as the problem only occurs rarely.
|
Ok, I just opened a pull request with possible fix for this issue. |
Possible fix for #44: wrong prepare method
fixed by #49 |
I'm using Django 1.7 (latest pull from stable/1.7 branch), but can recreate the issue with Django 1.6.
Full traceback below:
The text was updated successfully, but these errors were encountered: