+# lane form setup needs to come before Flowcell form config
+# as flowcell refers to the LaneInline class
+class LaneForm(ModelForm):
+ comment = CharField(widget=TextInput(attrs={'size':'80'}), required=False)
+
+ class Meta:
+ model = Lane
+
+class LaneInline(admin.StackedInline):
+ """
+ Controls display of Lanes on the Flowcell form.
+ """
+ model = Lane
+ max_num = 8
+ extra = 8
+ form = LaneForm
+ raw_id_fields = ('library',)
+ fieldsets = (
+ (None, {
+ 'fields': ('lane_number', 'flowcell',
+ ('library',),
+ ('pM', 'cluster_estimate'),
+ 'comment',)
+ }),
+ )
+
+class LaneOptions(admin.ModelAdmin):
+ """
+ Controls display of Lane browser
+ """
+ list_display = ('flowcell', 'lane_number', 'library', 'comment')
+ fieldsets = (
+ (None, {
+ 'fields': ('lane_number', 'flowcell',
+ ('library'),
+ ('pM', 'cluster_estimate'))
+ }),
+ ('Optional', {
+ 'classes': ('collapse', ),
+ 'fields': ('comment', )
+ }),
+ )
+