On 9/1/06, brian corrigan <[EMAIL PROTECTED]> wrote:
> the unique fields are not created.
> the same happens for unique_together=(("distribution_list",
> "subscriber"),)
I think the confusion here is over the word 'meta'.
Once upon a time, you defined models by starting out with:
from django.core import meta
But *within* the model itself, you specified extra options by adding
an inner class called 'META', like so:
from django.core import meta
class MyModel(meta.Model):
name = meta.CharField(maxlength=250)
blurb = meta.TextField()
class META:
unique_together = (('name', 'blurb'),)
'META', here, has nothing whatsoever to do with the class 'django.core.meta'.
Now, you do this:
from django.db import models
class MyModel(models.Model):
name = models.CharField(maxlength=250)
blurb = models.TextField()
Class Meta:
unique_together = (('name', 'blurb'),)
In other words, inside the model you define a class called 'Meta'.
This isn't an imported class, and there is no 'meta' class anywhere in
Django that you need to pull in -- it's a class that *you* create,
*inside* your model class.
--
"May the forces of evil become confused on the way to your house."
-- George Carlin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---