dropbox / nsot

Network Source of Truth is an open source IPAM and network inventory database
https://nsot.readthedocs.io
Other
399 stars 66 forks source link

Refactor common model helpers/validators into a single place #318

Open jathanism opened 6 years ago

jathanism commented 6 years ago

Following #317 @narJH27 had this feedback:

This looks great! Just one suggestion from my end, there are too many repetitions of clean_site(), clean_fields() and save() which I feel could easily be moved to a base class from where the specific model classes could subclass and overload the methods if needed. This is just to avoid duplication of the same block of code over and over again.

This is a great idea for the V2 API, to reduce duplication.