Show More
@@ -9,13 +9,13 b' from boards.models import Post, Tag, Ban' | |||||
9 | class PostAdmin(admin.ModelAdmin): |
|
9 | class PostAdmin(admin.ModelAdmin): | |
10 |
|
10 | |||
11 | list_display = ('id', 'title', 'text', 'poster_ip', 'linked_images', |
|
11 | list_display = ('id', 'title', 'text', 'poster_ip', 'linked_images', | |
12 | 'foreign') |
|
12 | 'foreign', 'tags') | |
13 | list_filter = ('pub_time',) |
|
13 | list_filter = ('pub_time',) | |
14 | search_fields = ('id', 'title', 'text', 'poster_ip') |
|
14 | search_fields = ('id', 'title', 'text', 'poster_ip') | |
15 | exclude = ('referenced_posts', 'refmap', 'images', 'global_id') |
|
15 | exclude = ('referenced_posts', 'refmap', 'images', 'global_id') | |
16 | readonly_fields = ('poster_ip', 'threads', 'thread', 'linked_images', |
|
16 | readonly_fields = ('poster_ip', 'threads', 'thread', 'linked_images', | |
17 | 'attachments', 'uid', 'url', 'pub_time', 'opening', 'linked_global_id', |
|
17 | 'attachments', 'uid', 'url', 'pub_time', 'opening', 'linked_global_id', | |
18 | 'version', 'foreign') |
|
18 | 'version', 'foreign', 'tags') | |
19 |
|
19 | |||
20 | def ban_poster(self, request, queryset): |
|
20 | def ban_poster(self, request, queryset): | |
21 | bans = 0 |
|
21 | bans = 0 | |
@@ -58,6 +58,9 b' class PostAdmin(admin.ModelAdmin):' | |||||
58 | args=[global_id.id]), str(global_id)) |
|
58 | args=[global_id.id]), str(global_id)) | |
59 | linked_global_id.allow_tags = True |
|
59 | linked_global_id.allow_tags = True | |
60 |
|
60 | |||
|
61 | def tags(self, obj: Post): | |||
|
62 | return ', '.join([tag.name for tag in obj.get_tags()]) | |||
|
63 | ||||
61 | def save_model(self, request, obj, form, change): |
|
64 | def save_model(self, request, obj, form, change): | |
62 | obj.increment_version() |
|
65 | obj.increment_version() | |
63 | obj.save() |
|
66 | obj.save() |
@@ -397,3 +397,6 b' class Post(models.Model, Viewable):' | |||||
397 | if global_id is not None and global_id.is_local()\ |
|
397 | if global_id is not None and global_id.is_local()\ | |
398 | and global_id.content is not None: |
|
398 | and global_id.content is not None: | |
399 | global_id.clear_cache() |
|
399 | global_id.clear_cache() | |
|
400 | ||||
|
401 | def get_tags(self): | |||
|
402 | return self.get_thread().get_tags() |
General Comments 0
You need to be logged in to leave comments.
Login now