Пример #1
0
from brewpi_service.admin import admin, ModelView
from brewpi_service.database import db_session

from .models import Controller

# Add basic models to admin
admin.add_view(ModelView(Controller, db_session))
Пример #2
0
from brewpi_service.database import db_session
from brewpi_service.admin import admin, ModelView

from .models import ClockDevice


class ClockDeviceAdminView(ModelView):
    column_hide_backrefs = False
    column_exclude_list = ('type', )
    # column_filters = ('controller',)


admin.add_view(ClockDeviceAdminView(ClockDevice, db_session))
Пример #3
0
from brewpi_service.database import db_session
from brewpi_service.admin import admin, ModelView

from .models import TemperatureSensorDevice, PID


class TemperatureSensorDeviceAdminView(ModelView):
    column_hide_backrefs = False
    column_exclude_list = ('type', )
    column_filters = ('controller', )


admin.add_view(
    TemperatureSensorDeviceAdminView(TemperatureSensorDevice, db_session))


class PIDAdminView(ModelView):
    column_hide_backrefs = True
    column_exclude_list = ('type', )
    column_filters = ('controller', )


admin.add_view(PIDAdminView(PID, db_session))
Пример #4
0
from brewpi_service.database import db_session
from brewpi_service.admin import admin, ModelView

from .models import LoggedDeviceConfiguration


class LoggedDeviceConfigurationAdminView(ModelView):
    column_hide_backrefs = False


admin.add_view(
    LoggedDeviceConfigurationAdminView(LoggedDeviceConfiguration, db_session))