|
@@ -7,6 +7,7 @@ from django.contrib import admin
|
|
from django.contrib.auth import get_user_model
|
|
from django.contrib.auth import get_user_model
|
|
from django.forms import ModelChoiceField
|
|
from django.forms import ModelChoiceField
|
|
from django.utils import timezone
|
|
from django.utils import timezone
|
|
|
|
+import autocomplete_light
|
|
|
|
|
|
from .models import ItemType, Item, Loan, Storage
|
|
from .models import ItemType, Item, Loan, Storage
|
|
import coin.members.admin
|
|
import coin.members.admin
|
|
@@ -143,6 +144,7 @@ class LoanAdmin(admin.ModelAdmin):
|
|
loan_date_end=datetime.now())
|
|
loan_date_end=datetime.now())
|
|
end_loan.short_description = 'Mettre fin au prêt'
|
|
end_loan.short_description = 'Mettre fin au prêt'
|
|
|
|
|
|
|
|
+ form = autocomplete_light.modelform_factory(Loan, fields='__all__')
|
|
|
|
|
|
def formfield_for_foreignkey(self, db_field, request, **kwargs):
|
|
def formfield_for_foreignkey(self, db_field, request, **kwargs):
|
|
if db_field.name == 'item':
|
|
if db_field.name == 'item':
|