Hi,
I have a problem when using MIT in my models. I created two new
classes which inherit model Entry:
class Entry(models.Model):
LANGUAGE_CHOICES = settings.LANGUAGES
language = models.CharField(max_length=2,
verbose_name=_('Comment language'), choices=LANGUAGE_CHOICES)
user = models.ForeignKey(User)
country = models.ForeignKey(Country, null=True, blank=True)
created = models.DateTimeField(auto_now=True)
class Comment(Entry):
comment = models.CharField(max_length=2000, blank=True,
verbose_name=_('Comment in English'))
class Discount(Entry):
discount = models.CharField(max_length=2000, blank=True,
verbose_name=_('Comment in English'))
coupon = models.CharField(max_length=2000, blank=True,
verbose_name=_('Coupon code if needed'))
After adding these new models to admin via admin.site.register I'm
getting ValueError when trying to create a comment or a discount via
admin. Adding entries works fine thou.
Error msg:
ValueError at /admin/reviews/discount/add/
Cannot assign "''": "Discount.discount" must be a "Discount" instance.
Request Method: GET
Request URL:
http://127.0.0.1:8000/admin/reviews/discount/add/
Exception Type: ValueError
Exception Value:
Cannot assign "''": "Discount.discount" must be a "Discount" instance.
Exception Location: /Library/Python/2.6/site-packages/django/db/models/
fields/related.py in __set__, line 211
Python Executable: /usr/bin/python
Python Version: 2.6.1
I'm running Django 1.1 and South 0.7 with this. To me this seems like
a textbook example made using Django docs but I can't seem to get it
working.
-Jori
Ps. I tried to find a solution to this via StackOverflow but with no
luck. I'll post the solution there is someone knows what's wrong with
this.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to
django...@googlegroups.com.
To unsubscribe from this group, send email to
django-users...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.