Gerard Petersen wrote:
> Daniel,
> 
>> If you want a field that's populated with values from another model,
>> you should use a ForeignKey.
> Is it then still possible to use filters and such, and keep it in the model 
> logic?
> 
> Because the Meta model has these fields: 'attribute', 'value', 'display', 
> 'description'
> 
> And it's more like a lookup then a real relation between the models Order and 
> Meta.
> 
>> Also, it's not a good idea to use Meta as the name of a model - that's
>> bound to get confused with the inner Meta class which defines model
>> meta-attributes like ordering.
> Thanx for the tip. I already saw this one coming ... ;-)

I would like to ask a similar but slightly more specific question.

An Oracle database I use keeps lookup data in a Lookups table with three
columns, to avoid many small tables (I assume). A Django model would be
something like (untested pseudo-code):

class Types(model.model):
    lktName = models.CharField(max_length=50)

class Lookups(models.Model):
    lkpType = models.ForeignKey(Types)
    lkpValue = models.CharField(max_length=50)

So I'd like to be able to populate drop-downs with (id, lkpValue) pairs
for a given value of lkpType. The related tables might use a ForeignKey,
but I certainly don't want to see all Lookups in a selection, just those
of the relevant type.

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/

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