model constraints changed and moved url to /device
This commit is contained in:
parent
10f2f6dc16
commit
04099d31a6
|
@ -28,10 +28,7 @@ class Property(models.Model):
|
|||
value = models.CharField(max_length=STR_EXTEND_SIZE)
|
||||
|
||||
class Meta:
|
||||
constraints = [
|
||||
models.UniqueConstraint(
|
||||
fields=["type", "key", "uuid"], name="unique_type_key_uuid")
|
||||
]
|
||||
#Only for shared behaviour, it is not a table
|
||||
abstract = True
|
||||
|
||||
class SystemProperty(Property):
|
||||
|
@ -43,6 +40,12 @@ class SystemProperty(Property):
|
|||
name='property_cannot_be_user'
|
||||
),
|
||||
]
|
||||
#Django orm wont inherit constraints to child
|
||||
#TODO: check if this is needed
|
||||
constraints = [
|
||||
models.UniqueConstraint(
|
||||
fields=["type", "key", "uuid"], name="system_unique_type_key_uuid")
|
||||
]
|
||||
|
||||
class UserProperty(Property):
|
||||
|
||||
|
@ -55,6 +58,10 @@ class UserProperty(Property):
|
|||
name='property_needs_to_be_user'
|
||||
),
|
||||
]
|
||||
constraints = [
|
||||
models.UniqueConstraint(
|
||||
fields=["type", "key", "uuid"], name="user_unique_type_key_uuid")
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -20,5 +20,4 @@ urlpatterns = [
|
|||
path("<uuid:pk>", views.EvidenceView.as_view(), name="details"),
|
||||
path("<uuid:pk>/eraseserver", views.EraseServerView.as_view(), name="erase_server"),
|
||||
path("<uuid:pk>/download", views.DownloadEvidenceView.as_view(), name="download"),
|
||||
path('user_property/<int:pk>/del', views.UserPropertyDeleteView.as_view(), name='delete_user_property'),
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue