restorm
restorm copied to clipboard
How to use it with ForeignKey?
Suppose I have a model like this
class FactoryBooking(model.Models):
factory = models.ForeignKey(Factory, verbose_name=_("factory"), related_name="factory_bookings")
mechanics = models.ManyToManyField(Mechanic, related_name="factory_bookings", verbose_name=_("mechanics"))
Is it possible to use restorm like
class FactoryBooking(models.Models):
factory = JSONClient(root_uri='https://myserver.com')
mechanics = JSONClient(root_uri='https://myserver2.com')
And use like this:
>> Factory.objects.create(factory=instance1, mechanics=instance2)