add language field to text model, output en and zh texts separately, refs #30
This commit is contained in:
parent
0c10a6ed2e
commit
21dab42524
5 changed files with 44 additions and 6 deletions
|
|
@ -36,7 +36,9 @@ def about(request):
|
|||
|
||||
def texts(request):
|
||||
context = {}
|
||||
context['texts'] = models.Text.objects.filter(public=True).order_by('position', 'created')
|
||||
all_texts = models.Text.objects.filter(public=True).order_by('position', 'created')
|
||||
context['en_texts'] = all_texts.filter(language='en')
|
||||
context['zh_texts'] = all_texts.filter(language='zh')
|
||||
return render(request, 'texts.html', context)
|
||||
|
||||
def text(request, slug):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue