Commits

Anonymous committed edf9645

出欠のフォーム作った

Comments (0)

Files changed (2)

src/RoomReservation/reservations/admin.py

 #    created by giginet on 2011/09/19
 #
 from django.contrib import admin
-from models import Reservation
+from models import Reservation, Attendance
 
 class ReservationAdmin(admin.ModelAdmin):
     date_hierarchy = 'updated_at'
     list_display = ('label', 'room', 'period_start', 'period_end',)
     list_filter = ('room',)
     
-admin.site.register(Reservation, ReservationAdmin)
+admin.site.register(Reservation, ReservationAdmin)
+
+class AttendanceAdmin(admin.ModelAdmin):
+    list_display = ('attend', 'user', 'reservation')
+    list_filter = ('user', 'reservation', )
+admin.site.register(Attendance, AttendanceAdmin)

src/RoomReservation/reservations/forms.py

 
 class ReservationForm(forms.ModelForm):
     author = forms.ModelChoiceField(queryset=User.objects.all(), widget = forms.HiddenInput())
+    users  = forms.ModelMultipleChoiceField(queryset=User.objects.all(), label=u'出席者')
     class Meta:
-        model = Reservation
+        model = Reservation