On Thu, Oct 23, 2008 at 5:48 AM, IL <[EMAIL PROTECTED]> wrote:

>
> from django.db import models
>
> class Song(models.Model):
>    name = models.CharField(max_length = 50, unique = True)
>    lyricBy = models.CharField(max_length = 10, null = True, blank =
> True)
>    coSinger = models.CharField(max_length = 10, null = True, blank =
> True)
>
>    def __str__(self):
>        return self.name
>
> class Album(models.Model):
>    name = models.CharField(max_length = 50, unique = True)
>    releaseDate = models.DateField(u'release date')
>    songs = models.ManyToManyField(Song)
>
>    def __str__(self):
>        return self.name
>
> ====================
> This is my models (django 1.0)
>

If you are using Django 1.0, then your models need to have __unicode__
methods, not __str__ methods.

Karen

--~--~---------~--~----~------------~-------~--~----~
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