Given the following models:
class BaseMachine(models.Model)
fqdn = models.CharField(max_length=150)
cpus = models.IntegerField()
memory = models.IntegerField()
class Meta:
abstract = True
class PhysicalMachine(BaseMachine)
location = models.CharField(max_length=150)
class VirtualMachine(BaseMachine)
hypervisor = models.CharField(max_length=5)
class Sysadmin(models.Model):
name = models.CharField(max_length=100)
admin_of = models.ManyToManyField...
In this example I would like to relate 1 sysadmin to many machines - be them either an instance or PhysicalMachine or VirtualMachine. I know I can't have a ManyToMany with an abstract base, but I was wondering if there was a better way of achieving this than just having a separate ManyToMany field on sysadmin for each of the models? In this small example that could be tolerable, but if you have more than 2 subclasses, or if there are other models which you need to relate with the 'base' class, it becomes something more to manage.
Thanks :)