All pastes #505643 Raw Edit

Anonymous

public python v1 · immutable
·published 2007-05-23 17:41 UTC
rendered paste body
from django.db import modelsclass parent(models.Model):	name = models.CharField()class childA(models.Model):	parent = models.ForeignKey(parent)	some_field = models.CharField()class childB(models.Model):	parent = models.ForeignKey(parent)	some_other_field = models.CharField()	some_field = models.ForeignKey(childA, limit_choices_to={'parent': 'parent.name'}) #This will make a select box for some_field values where childA.parent == 'parent.name'.  Is there a way to have it limit to childB.parent.__str__ (dynamic based on parent value selected)?