mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-15 19:45:46 +00:00
Create a custom URL field, which allows the user-specified validators
- Ref: https://stackoverflow.com/questions/41756572/django-urlfield-with-custom-scheme - Apply this to the URL field in the Part model
This commit is contained in:
@ -34,6 +34,7 @@ import hashlib
|
||||
from InvenTree import helpers
|
||||
from InvenTree import validators
|
||||
from InvenTree.models import InvenTreeTree
|
||||
from InvenTree.fields import InvenTreeURLField
|
||||
|
||||
from InvenTree.status_codes import BuildStatus, StockStatus, OrderStatus
|
||||
|
||||
@ -353,7 +354,7 @@ class Part(models.Model):
|
||||
|
||||
revision = models.CharField(max_length=100, blank=True, help_text='Part revision or version number')
|
||||
|
||||
URL = models.URLField(blank=True, help_text='Link to extenal URL')
|
||||
URL = InvenTreeURLField(blank=True, help_text='Link to extenal URL')
|
||||
|
||||
image = models.ImageField(upload_to=rename_part_image, max_length=255, null=True, blank=True)
|
||||
|
||||
|
Reference in New Issue
Block a user