Skip to content

Commit 2451810

Browse files
Fix: Business display order in board minutes (django#1868)
1 parent 24a4edc commit 2451810

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Diff for: foundation/admin.py

+9
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,14 @@ class CoreAwardAdmin(admin.ModelAdmin):
9999
list_display = ["recipient", "cohort"]
100100

101101

102+
# Register BusinessAdmin
103+
104+
105+
class BusinessAdmin(admin.ModelAdmin):
106+
list_display = ["title", "business_type", "meeting", "created_at"]
107+
ordering = ["created_at"]
108+
109+
110+
admin.site.register(models.Business, BusinessAdmin)
102111
admin.site.register(models.CoreAward, CoreAwardAdmin)
103112
admin.site.register(models.CoreAwardCohort)

Diff for: foundation/models.py

+1
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ class Business(models.Model):
207207
meeting = models.ForeignKey(
208208
Meeting, related_name="business", on_delete=models.CASCADE
209209
)
210+
created_at = models.DateTimeField(auto_now_add=True)
210211

211212
class Meta:
212213
ordering = ("title",)

Diff for: foundation/views.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ def get_context_data(self, **kwargs):
5151
)
5252
context_data["new_business"] = meeting.business.filter(
5353
business_type=models.Business.NEW
54-
)
54+
).order_by("created_at")
55+
5556
return context_data
5657

5758

0 commit comments

Comments
 (0)