mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
Add sorting, enforce foreign keys
This commit is contained in:
@@ -108,12 +108,14 @@ def tag_pre_save(sender, instance, **kwargs):
|
||||
|
||||
class RollingStockType(models.Model):
|
||||
type = models.CharField(max_length=64)
|
||||
order = models.PositiveSmallIntegerField()
|
||||
category = models.CharField(
|
||||
max_length=64, choices=settings.ROLLING_STOCK_TYPES
|
||||
)
|
||||
|
||||
class Meta(object):
|
||||
unique_together = ("category", "type")
|
||||
ordering = ["order"]
|
||||
|
||||
def __str__(self):
|
||||
return "{0} {1}".format(self.type, self.category)
|
||||
|
Reference in New Issue
Block a user