Commit c6d4420c by Florian Apolloner

Restored 1.5 compat.

parent 599f3df1
...@@ -5,7 +5,7 @@ from django.contrib.contenttypes.models import ContentType ...@@ -5,7 +5,7 @@ from django.contrib.contenttypes.models import ContentType
from django.db import models from django.db import models
from django.db.models.fields import Field from django.db.models.fields import Field
from django.db.models.fields.related import ManyToManyRel, RelatedField, add_lazy_relation from django.db.models.fields.related import ManyToManyRel, RelatedField, add_lazy_relation
from django.db.models.related import RelatedObject, PathInfo from django.db.models.related import RelatedObject
from django.utils.text import capfirst from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.utils import six from django.utils import six
......
from __future__ import unicode_literals, absolute_import from __future__ import unicode_literals, absolute_import
from django import forms from django import forms, VERSION
from .models import Food, DirectFood, CustomPKFood, OfficialFood from .models import Food, DirectFood, CustomPKFood, OfficialFood
fields = None
if VERSION >= (1,6):
fields = '__all__'
class FoodForm(forms.ModelForm): class FoodForm(forms.ModelForm):
class Meta: class Meta:
model = Food model = Food
fields = '__all__' fields = fields
class DirectFoodForm(forms.ModelForm): class DirectFoodForm(forms.ModelForm):
class Meta: class Meta:
model = DirectFood model = DirectFood
fields = '__all__' fields = fields
class CustomPKFoodForm(forms.ModelForm): class CustomPKFoodForm(forms.ModelForm):
class Meta: class Meta:
model = CustomPKFood model = CustomPKFood
fields = '__all__' fields = fields
class OfficialFoodForm(forms.ModelForm): class OfficialFoodForm(forms.ModelForm):
class Meta: class Meta:
model = OfficialFood model = OfficialFood
fields = '__all__' fields = fields
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment