Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 44 lines (33 sloc) 1.409 kb
f1158d0 re-organise plugin admin form, display new template files without reload...
Zenobius Jiricek authored
1 from django.forms import ModelForm
2 from django.forms import ModelChoiceField, ChoiceField
3
4 from .lib.choices import (
5 DynamicTemplateChoices,
6 DynamicChoice,
7 )
8
9 from .models import (
10 CProductTypesPlugin,
11 CProductsPlugin,
a26ff2f updated plugin to include icons for product types, insert the icon with ...
Zenobius Jiricek authored
12 ApplicationSettings,
f1158d0 re-organise plugin admin form, display new template files without reload...
Zenobius Jiricek authored
13 )
14
15
16 class CProductTypesAdminForm(ModelForm):
17
18 class Meta:
19 model = CProductTypesPlugin
20
21 def __init__(self, *args, **kwargs):
22 super(CProductTypesAdminForm, self).__init__(*args, **kwargs)
44c2109 separated template choices into containers and items, with some nice def...
Zenobius Jiricek authored
23 self.fields['container_template'].choices = DynamicTemplateChoices(
24 path = ApplicationSettings.PRODUCT_TYPE_CONTAINER_TEMPLATES,
25 include = '.html')
26 self.fields['item_template'].choices = DynamicTemplateChoices(
27 path = ApplicationSettings.PRODUCT_TYPE_ITEM_TEMPLATES,
28 include = '.html')
f1158d0 re-organise plugin admin form, display new template files without reload...
Zenobius Jiricek authored
29
30
31 class CProductsAdminForm(ModelForm):
32
33 class Meta:
34 model = CProductsPlugin
35
36 def __init__(self, *args, **kwargs):
37 super(CProductsAdminForm, self).__init__(*args, **kwargs)
44c2109 separated template choices into containers and items, with some nice def...
Zenobius Jiricek authored
38 self.fields['container_template'].choices = DynamicTemplateChoices(
39 path = ApplicationSettings.PRODUCT_CONTAINER_TEMPLATES,
40 include = '.html')
41 self.fields['item_template'].choices = DynamicTemplateChoices(
42 path = ApplicationSettings.PRODUCT_ITEM_TEMPLATES,
43 include = '.html')
Something went wrong with that request. Please try again.