Hey everyone, 
I need a help, regarding use of proxy models at foreignKey field.

class User(AbstractUser):
   is_customer  = models.BooleanField(default=False)
  .......

class Customer(User):
   objects = CustomerManger() # get_queryset will filtered out all the 
models based on 
                                                            is_customer 
field at User
    class Meta:
        proxy = True

class Subscription(models.Model):
    user = models.ForeignKey(Customer)


so, my question is that is there a way  to allow subscription model to be 
only created with instance of Customer model and not any other User model 
which is not Customer model.




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/91c357b3-9628-4393-88a5-7029f7ae7565n%40googlegroups.com.

Reply via email to