Hello,
When I first developed my application I created a table that stored
all the different types of materials

class Material(models.Model):
    material = models.CharField(maxlength=100)

To get all the materials in the table all I needed to do was query the
table.  Recently, I've been going through my code to see if I can
clean it up.  So I deleted my table Material and made it into a
'choices' attribute.  So now I have

class Collection(models.Model):

    THE_MATERIAL = (
        ('1', 'Paper'),('2', 'Plastic'),('3', 'Other'),
    )

    material = models.CharField(max_length=50, choices=THE_MATERIAL)

///////////////////

However, now I want to be able to do a query that returns all of the
values in THE_MATERIAL (even if it's not being used by any
collection).  How would the query be setup to do this?

Thanks


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