Skip to content

Commit

Permalink
registration: Update filter and search fields
Browse files Browse the repository at this point in the history
- Add filter by form
- Add search field
  • Loading branch information
harshithpabbati committed Feb 15, 2020
1 parent ed1ad27 commit 07f5084
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion registration/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ class ApplicationAdmin(ImportExportModelAdmin, ExportActionMixin, admin.ModelAdm

]
list_display = ('name', 'form', 'status', 'submissionTime', 'rsvp', 'checkIn')
list_filter = ('status', 'rsvp', 'checkIn')
list_filter = ('form', 'status', 'rsvp', 'checkIn')
search_fields = ['name', 'email', 'phone']
select2 = select2_modelform(Form, attrs={'width': '250px'})
form = select2
resource_class = ApplicationResource
Expand Down
2 changes: 1 addition & 1 deletion registration/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Form(models.Model):
rsvpSubject = models.TextField(blank=True, null=True)
rsvpMessage = RichTextField(max_length=5000, verbose_name="RSVP Email Message")
enableCheckIn = models.BooleanField(default=False, verbose_name="Enable Check-In")
admins = models.ManyToManyField(User, related_name='formAdmins', blank=True, default=get_first_user)
admins = models.ManyToManyField(User, related_name='formAdmins', blank=True)

class Meta:
verbose_name_plural = "Forms"
Expand Down

0 comments on commit 07f5084

Please sign in to comment.