-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from 5sControl/development
Development
- Loading branch information
Showing
48 changed files
with
1,033 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,35 @@ | ||
# from django.contrib import admin | ||
# from .models.camera import Camera | ||
# from .models.algorithm import Algorithm, CameraAlgorithm, CameraAlgorithmLog | ||
from django.contrib import admin | ||
from .models.camera import Camera, ZoneCameras | ||
from .models.algorithm import Algorithm, CameraAlgorithm, CameraAlgorithmLog | ||
|
||
|
||
# @admin.register(Camera) | ||
# class CamerasAdmin(admin.ModelAdmin): | ||
# list_filter = ("id",) | ||
@admin.register(Camera) | ||
class CamerasAdmin(admin.ModelAdmin): | ||
list_filter = ("id",) | ||
|
||
|
||
# @admin.register(Algorithm) | ||
# class AlgorithmAdmin(admin.ModelAdmin): | ||
# list_filter = ("id", "name") | ||
@admin.register(Algorithm) | ||
class AlgorithmAdmin(admin.ModelAdmin): | ||
list_filter = ("id", "name") | ||
|
||
|
||
# @admin.register(CameraAlgorithm) | ||
# class CameraAlgorithmAdmin(admin.ModelAdmin): | ||
# list_filter = ("id", "algorithm", "camera") | ||
@admin.register(CameraAlgorithm) | ||
class CameraAlgorithmAdmin(admin.ModelAdmin): | ||
list_filter = ("id", "algorithm", "camera") | ||
|
||
|
||
# @admin.register(CameraAlgorithmLog) | ||
# class CameraAlgorithmLogAdmin(admin.ModelAdmin): | ||
# list_filter = ("id",) | ||
@admin.register(CameraAlgorithmLog) | ||
class CameraAlgorithmLogAdmin(admin.ModelAdmin): | ||
list_filter = ("id",) | ||
|
||
|
||
@admin.register(ZoneCameras) | ||
class ZoneCamerasAdmin(admin.ModelAdmin): | ||
readonly_fields = ["is_active"] | ||
list_display = ( | ||
"camera", | ||
"name", | ||
"coords", | ||
"date_created", | ||
"date_updated" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Generated by Django 4.2.1 on 2023-06-05 10:22 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("CameraAlgorithms", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="ZoneCameras", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("coords", models.JSONField(verbose_name="Zone coordinates")), | ||
("name", models.CharField(blank=True, max_length=100, null=True)), | ||
("is_active", models.BooleanField(default=False)), | ||
( | ||
"date_created", | ||
models.DateTimeField( | ||
auto_now_add=True, verbose_name="Date created" | ||
), | ||
), | ||
( | ||
"date_updated", | ||
models.DateTimeField(auto_now=True, verbose_name="Date updated"), | ||
), | ||
( | ||
"camera", | ||
models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="Zone_cameras", | ||
to="CameraAlgorithms.camera", | ||
), | ||
), | ||
], | ||
), | ||
] |
19 changes: 19 additions & 0 deletions
19
src/CameraAlgorithms/migrations/0003_cameraalgorithm_zones.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 4.2.1 on 2023-06-06 12:03 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("CameraAlgorithms", "0002_zonecameras"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="cameraalgorithm", | ||
name="zones", | ||
field=models.JSONField( | ||
blank=True, null=True, verbose_name="Id zones algorithm" | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,32 @@ | ||
from django.contrib import admin | ||
from .models import Company | ||
from .models import License, Company | ||
|
||
|
||
@admin.register(Company) | ||
class CamerasAdmin(admin.ModelAdmin): | ||
@admin.register(License) | ||
class LicenseAdmin(admin.ModelAdmin): | ||
list_filter = ("id",) | ||
readonly_fields = ( | ||
'license_key', | ||
'name_company', | ||
'date_joined', | ||
'valid_until', | ||
'is_active', | ||
'count_cameras', | ||
'neurons_active' | ||
) | ||
|
||
|
||
@admin.register(Company) | ||
class CompanyAdmin(admin.ModelAdmin): | ||
list_display = ( | ||
"name_company", | ||
"city", | ||
"state", | ||
"website", | ||
"contact_email", | ||
"contact_phone", | ||
"contact_mobile_phone", | ||
"logo", | ||
"file", | ||
"date_joined", | ||
"date_edited", | ||
) |
Oops, something went wrong.