10 lines
349 B
Python
10 lines
349 B
Python
from django import forms
|
|
from .models import Order, Project
|
|
class ProjectForm(forms.ModelForm):
|
|
class Meta:
|
|
model = Project
|
|
fields = '__all__'
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
super().__init__(*args, **kwargs)
|
|
self.fields['order'].queryset = Order.objects.filter(status='completed', project__isnull=True) |