Reputation: 379
I have something similar to the example below
from django.db import models
from django.contrib.auth.models import User
class a(models.Model):
user = models.ForeignKey(User)
class b(a):
value = models.IntegerField()
class c(a):
model_id = models.IntegerField()
I have a User instance assigned to variable current_user
, is there any way I can make current_user.b_set
work? Thank you for reading.
Upvotes: 1
Views: 91
Reputation: 798626
The FK is on a
, not b
, so there is no "b_set". You can query User
for objects that have an a
that have a b
, but a_set
is the only property you have.
Upvotes: 1