I'm going to create some application with Django admin interface, with plugins in mind. For example I have some user class in billing application:
class User(models.Model):
    ContractNum = models.PositiveIntegerField(unique=True, blank=True, null=True ) 
    LastName = models.CharField(max_length=50,)
and I have cmdb application, which has another model:
class Switch(models.Model):
    Name = models.CharField(max_length=50, )
    Manufacturer = models.CharField(max_length=50, )
    Model = models.CharField(max_length=50, )
I would like to somehow virtually add to User model in billing application fields to have something like:
class User(models.Model):
    ContractNum = models.PositiveIntegerField(unique=True, blank=True, null=True ) 
    LastName = models.CharField(max_length=50,)
    Switch = models.ForeignKey(Switch, related_name='SwitchUsers')
when I'm installed application cmdb, without any change in billing application dynamically.
I've read about abstract class, but I don't see the way how to achieve what I want with it, because it will add User into cmdb application, and I want something keep billing without changes as main application for the开发者_如何转开发 project.
Create a third model with has a OneToOne to User and a ForeignKey to Switch.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论