I am trying to display the table in my Choice table.  However it's
error's out everytime I try to see the contents of the table.

In my python shell prompt I do the following and get the error

C:\django\mysite>python manage.py shell
(InteractiveConsole)
>>> from mysite.rugs.models import Choice
>>> c = Choice.objects.all()
>>> c
Traceback (most recent call last):
  File "<console>", line 1, in ?
  File "c:\Python24\lib\site-packages\django\db\models\query.py", line
102, in _
_repr__
    return repr(self._get_data())
  File "c:\Python24\lib\site-packages\django\db\models\base.py", line
86, in __r
epr__
    return '<%s: %s>' % (self.__class__.__name__, self)
TypeError: __str__ returned non-string (type Style)
>>>

Here are my choice models file

class Choice(models.Model):
    choice = models.ForeignKey(Style, edit_inline=models.TABULAR,
num_in_admin=5)
    size = models.ForeignKey(Size, core=True)
    price = models.ForeignKey(Price, core=True)

    def __str__(self,):
        return self.choice

Does anybody know why I can't display the data in the table?


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to