Commit 3064b6f9 authored by Amap's avatar Amap

On ne voit que les dates futures à la commande

parent 626d4b9e
......@@ -5,17 +5,24 @@ from django import forms
from django.core.validators import MinValueValidator
from .models import Panier, Paiement, Commande, Credit, Livraison
from django.utils import timezone
class NewCommandeForm(ModelForm):
def __init__(self,*args,**kwargs):
super (NewCommandeForm,self ).__init__(*args,**kwargs) # populates the post
self.fields['date'].queryset = Livraison.objects.filter(date__gt=timezone.now())
class Meta:
model = Commande
fields = ['quantite','date']
class BaseEditCommandeForm(NewCommandeForm):
class Meta(NewCommandeForm.Meta):
class BaseEditCommandeForm(ModelForm):
class Meta:
model = Commande
fields = ['quantite','date']
class FullEditCommandeForm(NewCommandeForm):
class Meta(NewCommandeForm.Meta):
class FullEditCommandeForm(BaseEditCommandeForm):
class Meta(BaseEditCommandeForm.Meta):
fields = '__all__'
class SelectArticleForm(ModelForm):
......
......@@ -46,7 +46,7 @@
{% if paniers_list.has_next %}
<li> <a href="?page1={{ paniers_list.next_page_number }}">Précédents</a></li>
<li><a href2="?page1={{ paniers_list.paginator.page_range|length }}"> >> </a></li>
<li><a href="?page1={{ paniers_list.paginator.page_range|length }}"> >> </a></li>
{% endif %}
</ul>
{% endif %}
......@@ -109,7 +109,7 @@
{% if credit_list.has_next %}
<li> <a href="?page2={{ credit_list.next_page_number }}">Précédents</a></li>
<li><a href2="?page2={{ credit_list.paginator.page_range|length }}"> >> </a></li>
<li><a href="?page2={{ credit_list.paginator.page_range|length }}"> >> </a></li>
{% endif %}
</ul>
{% endif %}
......
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 to comment