0

If you are looking for a way to put radio buttons in Django using MODELS you only need do something like this (e.g):

in models.py

class MonitoringPointsClass( models.Model ):

    monitoring_has_power = models.BooleanField(
       null = True, max_length = 1,
       default = None,
       choices = YES_NO,
       name = 'monitoring_has_power',
       blank = True,
       verbose_name = _( 'Electrified' ), )
    ...

in admin.py

class MonitoringPoints_InLine_MODELadmin( admin.ModelAdmin ):
    model = MonitoringPointsClass

    radio_fields = {
            'monitoring_has_power'   : admin.HORIZONTAL,
            ...
    }

    checkboxes_fields = {
            'it's do not exists I guess, why?!'... }

But I can't find anyway to do this using checkboxes instead radio buttons

Fernando Cesar
  • 131
  • 2
  • 6

0 Answers0