16 lines
474 B
Python
16 lines
474 B
Python
![]() |
from django.db import models
|
||
|
from django_extensions.db.models import ModificationDateTimeField
|
||
|
|
||
|
|
||
|
class Teile(models.Model):
|
||
|
name = models.TextField("Name of the part", null=False, blank=False)
|
||
|
modified = ModificationDateTimeField("last changed")
|
||
|
|
||
|
class Meta:
|
||
|
constraints = [
|
||
|
models.UniqueConstraint(fields=["name"], name="unique_names"),
|
||
|
]
|
||
|
indexes = [
|
||
|
models.Index(fields=["modified"], name="modified"),
|
||
|
]
|