mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 11:10:54 +00:00
Custom URL validators for more fields
This commit is contained in:
24
InvenTree/stock/migrations/0015_auto_20190913_1407.py
Normal file
24
InvenTree/stock/migrations/0015_auto_20190913_1407.py
Normal file
@ -0,0 +1,24 @@
|
||||
# Generated by Django 2.2.5 on 2019-09-13 14:07
|
||||
|
||||
import InvenTree.fields
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('stock', '0014_auto_20190908_0918'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='stockitem',
|
||||
name='URL',
|
||||
field=InvenTree.fields.InvenTreeURLField(blank=True, max_length=125),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='stockitemtracking',
|
||||
name='URL',
|
||||
field=InvenTree.fields.InvenTreeURLField(blank=True, help_text='Link to external page for further information'),
|
||||
),
|
||||
]
|
@ -23,6 +23,7 @@ from InvenTree import helpers
|
||||
|
||||
from InvenTree.status_codes import StockStatus
|
||||
from InvenTree.models import InvenTreeTree
|
||||
from InvenTree.fields import InvenTreeURLField
|
||||
|
||||
from part.models import Part
|
||||
|
||||
@ -308,7 +309,7 @@ class StockItem(models.Model):
|
||||
serial = models.PositiveIntegerField(blank=True, null=True,
|
||||
help_text='Serial number for this item')
|
||||
|
||||
URL = models.URLField(max_length=125, blank=True)
|
||||
URL = InvenTreeURLField(max_length=125, blank=True)
|
||||
|
||||
batch = models.CharField(max_length=100, blank=True, null=True,
|
||||
help_text='Batch code for this stock item')
|
||||
@ -715,7 +716,7 @@ class StockItemTracking(models.Model):
|
||||
|
||||
notes = models.CharField(blank=True, max_length=512, help_text='Entry notes')
|
||||
|
||||
URL = models.URLField(blank=True, help_text='Link to external page for further information')
|
||||
URL = InvenTreeURLField(blank=True, help_text='Link to external page for further information')
|
||||
|
||||
user = models.ForeignKey(User, on_delete=models.SET_NULL, blank=True, null=True)
|
||||
|
||||
|
Reference in New Issue
Block a user