Fix #381 -- Add location field (#398)

* add location field

* rearrange the display order
This commit is contained in:
jlwt90
2017-02-03 00:51:13 +08:00
committed by Raphael Michel
parent 01c3200258
commit 3037309711
5 changed files with 33 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-01 04:31
from __future__ import unicode_literals
from django.db import migrations
import pretix.base.i18n
class Migration(migrations.Migration):
dependencies = [
('pretixbase', '0060_auto_20170113_1438'),
]
operations = [
migrations.AddField(
model_name='event',
name='location',
field=pretix.base.i18n.I18nCharField(blank=True, max_length=200, null=True, verbose_name='Location'),
),
]

View File

@@ -51,6 +51,8 @@ class Event(LoggedModel):
:type presale_start: datetime
:param presale_end: No tickets will be sold after this date.
:type presale_end: datetime
:param location: venue
:type location: str
:param plugins: A comma-separated list of plugin names that are active for this
event.
:type plugins: str
@@ -99,6 +101,11 @@ class Event(LoggedModel):
verbose_name=_("Start of presale"),
help_text=_("No products will be sold before this date."),
)
location = I18nCharField(
null=True, blank=True,
max_length=200,
verbose_name=_("Location"),
)
plugins = models.TextField(
null=True, blank=True,
verbose_name=_("Plugins"),

View File

@@ -56,7 +56,8 @@ class EventWizardBasicsForm(I18nModelForm):
'date_from',
'date_to',
'presale_start',
'presale_end'
'presale_end',
'location',
]
widgets = {
'date_from': forms.DateTimeInput(attrs={'class': 'datetimepicker'}),
@@ -131,6 +132,7 @@ class EventUpdateForm(I18nModelForm):
'is_public',
'presale_start',
'presale_end',
'location',
]
widgets = {
'date_from': forms.DateTimeInput(attrs={'class': 'datetimepicker'}),

View File

@@ -11,6 +11,7 @@
{% bootstrap_field form.slug layout="horizontal" %}
{% bootstrap_field form.date_from layout="horizontal" %}
{% bootstrap_field form.date_to layout="horizontal" %}
{% bootstrap_field form.location layout="horizontal" %}
{% bootstrap_field form.currency layout="horizontal" %}
{% bootstrap_field form.is_public layout="horizontal" %}
</fieldset>

View File

@@ -8,6 +8,7 @@
{% bootstrap_field form.slug layout="horizontal" %}
{% bootstrap_field form.date_from layout="horizontal" %}
{% bootstrap_field form.date_to layout="horizontal" %}
{% bootstrap_field form.location layout="horizontal" %}
{% bootstrap_field form.currency layout="horizontal" %}
</fieldset>
<fieldset>