Hi
I have this 2 models
[CODE]
class FontFamily(models.Model):
name = models.CharField(max_length="50")
default_fontfile = models.ForeignKey('FontFile',
limit_choices_to =
{ 'id__in' : (1,2) }, # something like 'self.fontfile_set.all()' would
be nice
blank="True",
null="True")
class FontFile(models.Model):
name = models.CharField(max_length="50")
path = models.CharField(max_length="100")
font_family = models.ForeignKey(FontFamily)
[/CODE]
I want to use "limit_choices_to" to limit the default_fontfile chooses
in the django admin interface, to only allow the fontfiles which are
associated to the current fontfamily.
In this example I set them to the static values (1,2), but I want them
to be dynamic, callable.
Can this be solved on the module level?
Is there an alternative way for doing this in the admin interface, by
altering the drop-down list before it shows up?
I have found this related ticket:
http://code.djangoproject.com/ticket/2445
in this ticket it seems that the functionality is not currently
implemented in django
I'm using Django 1.0.
any help is very welcome :-)
Yves
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---