diff --git a/events/admin.py b/events/admin.py index c71f643..afa1670 100644 --- a/events/admin.py +++ b/events/admin.py @@ -48,12 +48,12 @@ admin.site.register(City, CityAdmin) class ProfileAdmin(admin.ModelAdmin): raw_id_fields = ('city',) - list_display = ('user', 'realname', 'city', 'web_url', 'send_notifications') - list_filter = ('send_notifications', 'user__last_login') + list_display = ('user', 'realname', 'city', 'web_url', 'send_notifications', 'do_not_track') + list_filter = ('send_notifications', 'do_not_track', 'user__last_login') admin.site.register(UserProfile, ProfileAdmin) class OrgAdmin(admin.ModelAdmin): - list_display = ('name', 'site') + list_display = ('name', 'slug', 'site') admin.site.register(Organization, OrgAdmin) class SponsorAdmin(admin.ModelAdmin): @@ -86,6 +86,7 @@ admin.site.register(Place, PlaceAdmin) class EventAdmin(admin.ModelAdmin): raw_id_fields = ('place', 'created_by', 'sponsors') list_display = ('__str__', 'attendee_count', 'start_time', 'created_by', 'created_time') + list_filter = ('created_time', ('created_by',admin.RelatedOnlyFieldListFilter), ('team',admin.RelatedOnlyFieldListFilter)) ordering = ('-start_time',) def attendee_count(self, event): return event.attendees.all().count() diff --git a/events/models/events.py b/events/models/events.py index b0a6223..3c9cc08 100644 --- a/events/models/events.py +++ b/events/models/events.py @@ -91,7 +91,7 @@ class Event(models.Model): attendees = models.ManyToManyField(UserProfile, through='Attendee', related_name="attending", blank=True) - sponsors = models.ManyToManyField('Sponsor', related_name='events') + sponsors = models.ManyToManyField('Sponsor', related_name='events', blank=True) @property def is_over(self): diff --git a/events/models/profiles.py b/events/models/profiles.py index d08cd74..bde610a 100644 --- a/events/models/profiles.py +++ b/events/models/profiles.py @@ -310,10 +310,10 @@ class Team(models.Model): category = models.ForeignKey('Category', on_delete=models.SET_NULL, blank=False, null=True) topics = models.ManyToManyField('Topic', blank=True) - sponsors = models.ManyToManyField('Sponsor', related_name='teams') + sponsors = models.ManyToManyField('Sponsor', related_name='teams', blank=True) is_premium = models.BooleanField(default=settings.EVENTS_TEAMS_DEFAULT_PREMIUM) - premium_by = models.ForeignKey(UserProfile, related_name='premium_teams', null=True, on_delete=models.SET_NULL) + premium_by = models.ForeignKey(UserProfile, related_name='premium_teams', null=True, blank=True, on_delete=models.SET_NULL) premium_started = models.DateTimeField(blank=True, null=True) premium_expires = models.DateTimeField(blank=True, null=True)