Like Ramiro says.  It's an indentation issue.

Your nested class Admin: pass statement needs to be one and only one
level of indentation below the top class declaration for each class
that you're defining:

class Publisher(model.Model):
     ...
     class Admin: pass

class Foo(model.Model):
     ...
     class Admin: pass

Good luck

On Jan 6, 3:33 pm, "Ramiro Morales" <[EMAIL PROTECTED]> wrote:
> On Jan 6, 2008 5:10 PM, Mikey3D <[EMAIL PROTECTED]> wrote:
>
>
>
> > [...]
> > from django.db import models
>
> > class Publisher(models.Model):
> >     name = models.CharField(max_length=30)
> >     address = models.CharField(max_length=50)
> >     city = models.CharField(max_length=60)
> >     state_province = models.CharField(max_length=30)
> >     country = models.CharField(max_length=50)
> >     website = models.URLField()
>
> > class Admin: pass
>
> > def __str__(self):
> >     return self.name
>
> > class Meta:
> >     ordering = ["name"]
>
> So, is this a copy/paste error or you are really defining what
> should be model inner classes (Admin, Meta) as top-level classes?.
>
> If he latter, that could be a posible reason for he behaviour you are
> seeing. Rewrite them
> like:
>
> class Publisher(models.Model):
>     name = models.CharField(max_length=30)
>     address = models.CharField(max_length=50)
>     city = models.CharField(max_length=60)
>     state_province = models.CharField(max_length=30)
>     country = models.CharField(max_length=50)
>     website = models.URLField()
>
>     class Admin: pass
>
>     def __str__(self):
>         return self.name
>
>     class Meta:
>         ordering = ["name"]
>
> (same thing for the model methods)
>
> Regards,
>
> --
>  Ramiro Morales
--~--~---------~--~----~------------~-------~--~----~
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