On Thu, Oct 04, 2018 at 10:42:02AM +0200, Federico Capoano wrote:
> I think default settings similar to these below would give the best result, 
> the
> hardware ID field id is disabled and not shown by default but it's required if
> enabled and that can be changed if needed:
> 
> HARDWARE_ID_ENABLED = getattr(settings,
> 'DJANGO_NETJSONCONFIG_HARDWARE_ID_ENABLED', False)
> # defaults
> HARDWARE_ID_OPTIONS = {
>     'blank': not HARDWARE_ID_ENABLED,
>     'label': _('serial number'),
>     'help_text': _('some helpful text here'),
>     'maxlength': 32
> }
> HARDWARE_ID_OPTIONS.update(getattr(settings,
> 'DJANGO_NETJSONCONFIG_HARDWARE_ID_OPTIONS', {}))
> 
> # model field then is initialized like:
> hardware_id = CharField(**HARDWARE_ID_OPTIONS)

Ok, I'm fine with that :-)

Greetings,
Oliver

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to