On Wed, Nov 11, 2009 at 12:06 PM, django_fo...@codechimp.net < codech...@gmail.com> wrote:
> > I am sorry, it was up all night working on this, and I was tired, and > honestly didn't want to piss anyone off or offend anyone. > > I was not angry or offended, sorry if I gave that impression. I was just trying to explain why it is in posters' best interest to post the actual code they are using, not an approximation, and include relevant information such as the traceback. > ...here is the actual code in question: > > Snippet from models.py: > class DisneySpotType(models.Model): > name = models.CharField(max_length=128, primary_key=True) > > def __unicode__(self): > return self.name > > class Meta: > ordering = ['name'] > verbose_name = 'Disney Spot Type' > verbose_name_plural = 'Disney Spot Types' > > class DisneySpot(models.Model): > PARK_CHOICES = ( > ('MK','Magic Kingdom'), > ('E','Epcot'), > ('HS','Holywood Studios'), > ('AK','Animal Kingdom'), > ('O','Other'), > ) > name = models.CharField(max_length=256) > description = models.TextField(DisneySpotType) > Why is DisneySpotType being supplied as an argument here? The first positional argument for a TextField is an optional verbose name for the field (see http://docs.djangoproject.com/en/dev/topics/db/models/#verbose-field-names). The traceback shows that the code is running into trouble trying to create the formfield for a TextField, specifically trying to apply unicode() to the field's verbose name. Since the verbose name for this field has been set to a model class, you get the error message indicating an attempt to apply unicode() to the class as opposed to an instance of the class. Karen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---