mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-22 16:02:16 +00:00
Added form validation
* Asset IDs must be unique * Asset IDs that are legacy and unchange have no validation applied * Asset IDs must be alphanumeric * Values must be >=0 * Lengths, CSAs, Circuits and Cores of cables must all be >0
This commit is contained in:
@@ -40,7 +40,7 @@ class Supplier(models.Model):
|
||||
class Asset(PolymorphicModel):
|
||||
|
||||
parent = models.ForeignKey(to='self', related_name='asset_parent', blank=True, null=True, on_delete=models.SET_NULL)
|
||||
asset_id = models.CharField(max_length=10)
|
||||
asset_id = models.CharField(max_length=10, unique=True)
|
||||
description = models.CharField(max_length=120)
|
||||
category = models.ForeignKey(to=AssetCategory, on_delete=models.CASCADE)
|
||||
status = models.ForeignKey(to=AssetStatus, on_delete=models.CASCADE)
|
||||
|
||||
Reference in New Issue
Block a user