mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
Custom URL validators for more fields
This commit is contained in:
24
InvenTree/company/migrations/0008_auto_20190913_1407.py
Normal file
24
InvenTree/company/migrations/0008_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 = [
|
||||
('company', '0007_remove_supplierpart_lead_time'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='company',
|
||||
name='URL',
|
||||
field=InvenTree.fields.InvenTreeURLField(blank=True, help_text='Link to external company information'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='supplierpart',
|
||||
name='URL',
|
||||
field=InvenTree.fields.InvenTreeURLField(blank=True, help_text='URL for external supplier part link'),
|
||||
),
|
||||
]
|
@ -19,6 +19,7 @@ from django.urls import reverse
|
||||
from django.conf import settings
|
||||
from django.contrib.staticfiles.templatetags.staticfiles import static
|
||||
|
||||
from InvenTree.fields import InvenTreeURLField
|
||||
from InvenTree.status_codes import OrderStatus
|
||||
from common.models import Currency
|
||||
|
||||
@ -85,7 +86,7 @@ class Company(models.Model):
|
||||
contact = models.CharField(max_length=100,
|
||||
blank=True, help_text='Point of contact')
|
||||
|
||||
URL = models.URLField(blank=True, help_text='Link to external company information')
|
||||
URL = InvenTreeURLField(blank=True, help_text='Link to external company information')
|
||||
|
||||
image = models.ImageField(upload_to=rename_company_image, max_length=255, null=True, blank=True)
|
||||
|
||||
@ -238,7 +239,7 @@ class SupplierPart(models.Model):
|
||||
|
||||
MPN = models.CharField(max_length=100, blank=True, help_text='Manufacturer part number')
|
||||
|
||||
URL = models.URLField(blank=True, help_text='URL for external supplier part link')
|
||||
URL = InvenTreeURLField(blank=True, help_text='URL for external supplier part link')
|
||||
|
||||
description = models.CharField(max_length=250, blank=True, help_text='Supplier part description')
|
||||
|
||||
|
Reference in New Issue
Block a user