Just for clarifcation did you mean two ForeignKey pointing to the Device ? Shouldn't one be pointing to device config or device context?
Creating a new django app in which you add a new model, eg: DeviceIp, in > which you add a ForeignKey field pointing to Device and a ForeignKey > pointing to Device, the two fields should be flagged as unique_together > (look all these terms on the django documentation). > > Then add a signal receiver function in this new app which listens to save > events on Device, return if the "created" parameter is False so that you > act only on created devices, and in this function you add the logic to > write to the context field of the Device. There should be a method in > django-ipam to get the first available ip from a subnet. > > Then you should decide also how to manage subnets, if all devices are on > the same subnet is easy, otherwise you should probably have a way to tell > the system to which subnet the device pertains to. > > Thanks > Federico > -- You received this message because you are subscribed to the Google Groups "OpenWISP" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/a6421bcd-6ef2-42db-8f93-45be5e43b2c9%40googlegroups.com.
