mirror of
https://github.com/bratusev07/skb-market.git
synced 2026-12-04 20:59:45 +00:00
61 lines
1.9 KiB
Python
61 lines
1.9 KiB
Python
from django import forms
|
|
|
|
from .models import Game
|
|
|
|
|
|
class GameCreateForm(forms.ModelForm):
|
|
class Meta:
|
|
model = Game
|
|
fields = [
|
|
"title",
|
|
"author_name",
|
|
"short_description",
|
|
"description",
|
|
"icon",
|
|
"file",
|
|
"version",
|
|
"unity_version",
|
|
"tags",
|
|
]
|
|
|
|
labels = {
|
|
"title": "Название приложения",
|
|
"author_name": "Автор / команда",
|
|
"short_description": "Краткое описание",
|
|
"description": "Полное описание",
|
|
"icon": "Иконка",
|
|
"file": "Архив приложения",
|
|
"version": "Версия приложения",
|
|
"unity_version": "Версия Unity",
|
|
"tags": "Теги",
|
|
}
|
|
|
|
widgets = {
|
|
"title": forms.TextInput(
|
|
attrs={"class": "form-control"}
|
|
),
|
|
"author_name": forms.TextInput(
|
|
attrs={"class": "form-control"}
|
|
),
|
|
"short_description": forms.Textarea(
|
|
attrs={"class": "form-control", "rows": 3}
|
|
),
|
|
"description": forms.Textarea(
|
|
attrs={"class": "form-control", "rows": 6}
|
|
),
|
|
"icon": forms.ClearableFileInput(
|
|
attrs={"class": "form-control"}
|
|
),
|
|
"file": forms.ClearableFileInput(
|
|
attrs={"class": "form-control"}
|
|
),
|
|
"version": forms.TextInput(
|
|
attrs={"class": "form-control"}
|
|
),
|
|
"unity_version": forms.TextInput(
|
|
attrs={"class": "form-control"}
|
|
),
|
|
"tags": forms.SelectMultiple(
|
|
attrs={"class": "form-select"}
|
|
),
|
|
} |