admin
sensor.admin
¤
Classes¤
PermissionsBaseAdmin
¤
Bases: GuardedModelAdmin
Base admin class for models that require permissions.
Functions¤
formfield_for_choice_field(db_field, request, **kwargs)
¤
Limit the queryset for choice fields.
Source code in management\admin.py
75 76 77 78 79 80 81 |
|
formfield_for_foreignkey(db_field, request, **kwargs)
¤
Limit the queryset for foreign key fields.
Source code in management\admin.py
66 67 68 69 70 71 72 73 |
|
get_queryset(request)
¤
Return a queryset of the objects that the user has view permissions for.
Source code in management\admin.py
59 60 61 62 63 64 |
|
has_change_permission(request, obj=None)
¤
Check if the user has the correct permission to change the object.
Source code in management\admin.py
23 24 25 26 27 28 29 |
|
has_delete_permission(request, obj=None)
¤
Check if the user has the correct permission to delete the object.
Source code in management\admin.py
31 32 33 34 35 |
|
has_view_permission(request, obj=None)
¤
Check if the user has the correct permission to view the object.
Source code in management\admin.py
37 38 39 40 41 42 |
|
obj_perms_manage_view(request, object_pk)
¤
Prevents permission scalation at object level.
Only allows users with change permissions for this object to change the object permissions.
Source code in management\admin.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
Sensor
¤
Bases: PermissionsBase
Specific sensor details.
Attributes:
Name | Type | Description |
---|---|---|
sensor_id |
int
|
Primary key, sensor id. |
code |
(str) sensor code. |
|
sensor_type |
SensorType
|
sensor type. |
sensor_brand |
SensorBrand
|
sensor brand. |
model |
str
|
specific model of the sensor. |
serial |
str
|
serial number of the sensor. |
status |
bool
|
sensor status. |
Functions¤
__str__()
¤
Return the sensor code.
Source code in sensor\models.py
112 113 114 |
|
get_absolute_url()
¤
Return the absolute url of the sensor.
Source code in sensor\models.py
116 117 118 |
|
SensorAdmin
¤
SensorBrand
¤
Bases: PermissionsBase
Brand of the sensor, eg. Davis, Texas Electronics, etc.
Attributes:
Name | Type | Description |
---|---|---|
brand_id |
int, primary key, sensor brand id. |
|
name |
str, sensor brand name. |
Functions¤
__str__()
¤
Return the brand name.
Source code in sensor\models.py
52 53 54 |
|
get_absolute_url()
¤
Return the absolute url of the sensor brand.
Source code in sensor\models.py
56 57 58 |
|
SensorBrandAdmin
¤
SensorType
¤
Bases: PermissionsBase
Type of sensor, eg. pluviometric, wind sensor, etc.
Attributes:
Name | Type | Description |
---|---|---|
sensor_type_id |
int, primary key, sensor type id. |
|
name |
str, sensor type name. |
Functions¤
__str__()
¤
Return the sensor type name.
Source code in sensor\models.py
32 33 34 |
|
get_absolute_url()
¤
Return the absolute url of the sensor type.
Source code in sensor\models.py
36 37 38 |
|