Skip to content

v1.1.0

Compare
Choose a tag to compare
@aruhier aruhier released this 05 Jul 22:43
· 24 commits to master since this release
9c7c11c

v1.1.0

  • Fix foreign keys behavior: now, when a foreign key is detected, the attribute will be transformed as a mapper targeting the foreign object. Black magic is done by using properties to fetch this object in a JIT way: accessing the attribute for the first time will trigger a request to fetch it, and put it in a local cache to avoid any new request for next accesses.

  • Fix serialization of netbox choices: when using put() on an object containing a netbox enum (or "choice"), the integer value will be cherry-picked from the dict, then sent to netbox. Not ideal for now, could be improved later, but at least works.

  • Handle specific cases when a mapper cannot be generated after a POST. Typically, a GET on /ipam/prefixes/{id}/available-prefixes/ returns objects without ID. It is now handled, and will return the json as received.

  • post() in mappers now handles mappers as foreign keys. Doing m.post(foo=bar) when bar is a NetboxMapper is now possible, and will automatically use its id.

Documentation will be added and updated relatively to these changes.