Skip to content

Commit

Permalink
refactor: impacts #17, #21, and #6, making Category many-to-many
Browse files Browse the repository at this point in the history
  • Loading branch information
erictheise committed Mar 24, 2020
1 parent d5940c4 commit c3b4a30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mdi/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class OrganizationSocialNetworkInline(admin.TabularInline):
@admin.register(Organization)
class OrganizationAdmin(admin.OSMGeoAdmin):
list_display = ('name', 'city', 'country',)
list_filter = ('source', 'category', 'type', 'sectors', 'country',)
list_filter = ('source', 'categories', 'type', 'sectors', 'country',)
search_fields = ['name', 'description', ]
inlines = [OrganizationSocialNetworkInline]
ordering = [Lower('name'), ]
Expand Down
2 changes: 1 addition & 1 deletion mdi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Organization(models.Model):
founded = models.DateTimeField(blank=True, null=True)
num_workers = models.IntegerField(blank=True, null=True)
# num_impacted = models.IntegerField(blank=True)
category = models.ForeignKey(Category, on_delete=models.CASCADE, blank=True, null=True)
categories = models.ManyToManyField(Category, blank=True, null=True)
source = models.ForeignKey(Source, on_delete=models.CASCADE, blank=True, null=True)
type = models.ForeignKey(Type, on_delete=models.CASCADE, blank=True, null=True)
sectors = models.ManyToManyField(Sector, blank=True, null=True)
Expand Down

0 comments on commit c3b4a30

Please sign in to comment.