I have two models implemented like
class A(models.Model):
a_name = models.CharField(max_length=50)
class B(models.Model):
a = models.ForeignKey(A)
b_tag = models.CharField(max_length=50)
user=models.ForeignKey(User) # stores username
Now I define an A admin and register it with B as a subclass to TabularInline. I wonder if it is possible somehow to filter the list of B objects before the inline formset is rendered, so not all B objects related to A get into the formset, only ones whose user parameter matches the currently logged in user shows up!

所有评论(0)