Skip to content
Snippets Groups Projects

Include models in admin interface

Merged Jonathan Weth requested to merge feature/admin-interface into master
3 files
+ 261
12
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 9
0
from django.utils.formats import date_format
def format_m2m(f, attr: str = "short_name"):
return ", ".join([getattr(x, attr) for x in f.all()])
def format_date_period(date, period):
return "{}, {}.".format(date_format(date), period.period)
Loading