mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Create thumbnails for Company model
This commit is contained in:
parent
16d3a87e78
commit
1a233e7949
20
InvenTree/company/migrations/0014_auto_20200407_0116.py
Normal file
20
InvenTree/company/migrations/0014_auto_20200407_0116.py
Normal file
@ -0,0 +1,20 @@
|
||||
# Generated by Django 2.2.10 on 2020-04-07 01:16
|
||||
|
||||
import company.models
|
||||
from django.db import migrations
|
||||
import stdimage.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('company', '0013_auto_20200406_0131'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='company',
|
||||
name='image',
|
||||
field=stdimage.models.StdImageField(blank=True, null=True, upload_to=company.models.rename_company_image),
|
||||
),
|
||||
]
|
@ -21,6 +21,8 @@ from django.conf import settings
|
||||
|
||||
from markdownx.models import MarkdownxField
|
||||
|
||||
from stdimage.models import StdImageField
|
||||
|
||||
from InvenTree.fields import InvenTreeURLField, RoundingDecimalField
|
||||
from InvenTree.status_codes import OrderStatus
|
||||
from common.models import Currency
|
||||
@ -90,7 +92,13 @@ class Company(models.Model):
|
||||
|
||||
link = 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)
|
||||
image = StdImageField(
|
||||
upload_to=rename_company_image,
|
||||
null=True,
|
||||
blank=True,
|
||||
variations={'thumnbnail': (128, 128)},
|
||||
delete_orphans=True,
|
||||
)
|
||||
|
||||
notes = MarkdownxField(blank=True)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user