forked from DGNum/gestioCOF
fixes + deprecated migration
This commit is contained in:
parent
3bc9880db1
commit
de522a0035
|
@ -8,6 +8,7 @@ from datetime import timedelta
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.forms.models import BaseInlineFormSet
|
from django.forms.models import BaseInlineFormSet
|
||||||
|
from django.db.models import Q
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from bda.models import Attribution, Spectacle
|
from bda.models import Attribution, Spectacle
|
||||||
|
|
||||||
|
@ -67,8 +68,9 @@ class AnnulForm(forms.Form):
|
||||||
self.fields['attributions'].queryset = participant.attribution_set\
|
self.fields['attributions'].queryset = participant.attribution_set\
|
||||||
.filter(spectacle__date__gte=timezone.now(),
|
.filter(spectacle__date__gte=timezone.now(),
|
||||||
revente__isnull=False,
|
revente__isnull=False,
|
||||||
revente__date__gte=timezone.now()-timedelta(hours=1),
|
revente__date__gte=timezone.now()-timedelta(hours=1))\
|
||||||
revente__seller=participant)
|
.filter(Q(revente__soldTo__isnull=True) |
|
||||||
|
Q(revente__soldTo=participant))
|
||||||
|
|
||||||
|
|
||||||
class InscriptionReventeForm(forms.Form):
|
class InscriptionReventeForm(forms.Form):
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models, migrations
|
|
||||||
import django.utils.timezone
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('bda', '0007_extends_spectacle'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='SpectacleRevente',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
||||||
('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Date de mise en vente')),
|
|
||||||
('attribution', models.OneToOneField(related_name='revente', to='bda.Attribution')),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='participant',
|
|
||||||
name='choicesrevente',
|
|
||||||
field=models.ManyToManyField(related_name='revente', to='bda.Spectacle', blank=True),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='spectaclerevente',
|
|
||||||
name='interested',
|
|
||||||
field=models.ManyToManyField(related_name='wanted', to='bda.Participant', blank=True),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='spectaclerevente',
|
|
||||||
name='soldTo',
|
|
||||||
field=models.ForeignKey(blank=True, to='bda.Participant', null=True),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -12,7 +12,7 @@
|
||||||
{% if shotgun %}
|
{% if shotgun %}
|
||||||
<br>
|
<br>
|
||||||
<h3>Places disponibles immédiatement</h3>
|
<h3>Places disponibles immédiatement</h3>
|
||||||
<ul>
|
<ul class="list-unstyled">
|
||||||
{% for spectacle in shotgun %}
|
{% for spectacle in shotgun %}
|
||||||
<li><a href="{% url "bda-buy-revente" spectacle.id %}">{{spectacle}}</a></li>
|
<li><a href="{% url "bda-buy-revente" spectacle.id %}">{{spectacle}}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in a new issue