mirror of
https://github.com/pinry/pinry.git
synced 2025-11-13 00:25:41 +01:00
Refactor apps to be in repo folder
This commit is contained in:
18
core/forms.py
Normal file
18
core/forms.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from django import forms
|
||||
|
||||
from django_images.models import Image
|
||||
|
||||
|
||||
FIELD_NAME_MAPPING = {
|
||||
'image': 'qqfile',
|
||||
}
|
||||
|
||||
|
||||
class ImageForm(forms.ModelForm):
|
||||
def add_prefix(self, field_name):
|
||||
field_name = FIELD_NAME_MAPPING.get(field_name, field_name)
|
||||
return super(ImageForm, self).add_prefix(field_name)
|
||||
|
||||
class Meta:
|
||||
model = Image
|
||||
fields = ('image',)
|
||||
Reference in New Issue
Block a user