Skip to content

Commit

Permalink
Add Pc inline for Stations in admin
Browse files Browse the repository at this point in the history
The Pc model should probably be merged into the Station model,
this makes managing them easier for now.
  • Loading branch information
153957 committed Apr 7, 2024
1 parent 06834fd commit 923ca61
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions publicdb/inforecords/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ class StationInline(admin.StackedInline):
can_delete = False


class PcInline(admin.StackedInline):
model = models.Pc
extra = 0 # this stops empty forms being shown
max_num = 0 # this removes the add more button
can_delete = False


@admin.register(models.Contact)
class ContactAdmin(admin.ModelAdmin):
list_display = ('first_name', 'last_name', 'email_work_link')
Expand Down Expand Up @@ -53,6 +60,8 @@ class StationAdmin(admin.ModelAdmin):
list_filter = ('cluster__country',)
list_per_page = 200

inlines = (PcInline,)


@admin.register(models.ContactInformation)
class ContactInformationAdmin(admin.ModelAdmin):
Expand Down

0 comments on commit 923ca61

Please sign in to comment.