Language exceptions, no visual column
This commit is contained in:
parent
13d9dafbd9
commit
d97112373e
3 changed files with 11 additions and 3 deletions
|
@ -49,7 +49,10 @@ def parse(obj, raw, stream):
|
|||
obj.content = ''
|
||||
|
||||
# Detect language
|
||||
try:
|
||||
obj.lang = guess_language(obj.content) or ''
|
||||
except:
|
||||
obj.lang = ''
|
||||
|
||||
# Collect tags
|
||||
tags = []
|
||||
|
|
|
@ -40,9 +40,14 @@ class Entry(models.Model):
|
|||
tags = models.TextField(blank=True)
|
||||
|
||||
stream = models.ForeignKey(Stream,
|
||||
blank=True, on_delete=models.CASCADE,
|
||||
blank=False, on_delete=models.CASCADE,
|
||||
verbose_name='Original stream')
|
||||
|
||||
@property
|
||||
def no_image(self):
|
||||
if not self.visual: return 'X'
|
||||
return ''
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = 'Entries'
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ class EntryModelAdmin(ModelAdmin):
|
|||
menu_order = 200
|
||||
add_to_settings_menu = False
|
||||
exclude_from_explorer = True
|
||||
list_display = ('published', 'title', 'author', 'tags')
|
||||
list_display = ('published', 'title', 'no_image', 'lang')
|
||||
list_filter = ('author', 'tags')
|
||||
search_fields = ('title', 'author', 'content', 'tags')
|
||||
|
||||
|
|
Loading…
Reference in a new issue