msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-09-10 15:34+0200\n"
+"POT-Creation-Date: 2020-09-17 10:36+0200\n"
"PO-Revision-Date: 2013-04-09 10:38+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-09-10 15:34+0200\n"
+"POT-Creation-Date: 2020-09-17 10:36+0200\n"
"PO-Revision-Date: 2013-04-09 10:38+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-09-10 15:34+0200\n"
+"POT-Creation-Date: 2020-09-17 10:36+0200\n"
"PO-Revision-Date: 2013-04-09 10:39+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-09-10 15:34+0200\n"
+"POT-Creation-Date: 2020-09-17 10:36+0200\n"
"PO-Revision-Date: 2013-04-09 10:38+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-09-10 15:34+0200\n"
+"POT-Creation-Date: 2020-09-17 10:36+0200\n"
"PO-Revision-Date: 2013-04-09 10:39+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-09-10 15:34+0200\n"
+"POT-Creation-Date: 2020-09-17 10:36+0200\n"
"PO-Revision-Date: 2013-04-09 10:40+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgstr ""
"Project-Id-Version: WolneLektury\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-09-10 15:34+0200\n"
-"PO-Revision-Date: 2015-12-31 16:45+0100\n"
+"POT-Creation-Date: 2020-09-17 10:36+0200\n"
+"PO-Revision-Date: 2020-09-18 15:34+0200\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org."
"pl>\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
"X-Translated-Using: django-rosetta 0.5.6\n"
-"X-Generator: Poedit 1.8.4\n"
+"X-Generator: Poedit 2.3\n"
#: catalogue/constants.py:9
msgid "Creative Commons Attribution-ShareAlike 3.0 Unported"
msgstr "okładka dla aplikacji"
#: catalogue/models/book.py:107
-#, fuzzy
-#| msgid "cover for mobile app"
msgid "cover for Ebookpoint"
-msgstr "okładka dla aplikacji"
+msgstr "okładka dla Ebookpoint"
#: catalogue/models/book.py:136 catalogue/models/collection.py:19
msgid "book"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-09-10 15:34+0200\n"
+"POT-Creation-Date: 2020-09-17 10:36+0200\n"
"PO-Revision-Date: 2013-04-09 10:40+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-09-10 15:34+0200\n"
+"POT-Creation-Date: 2020-09-17 10:36+0200\n"
"PO-Revision-Date: 2013-04-09 10:40+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
--- /dev/null
+# Generated by Django 2.2.16 on 2020-09-18 13:29
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('catalogue', '0029_auto_20200414_1516'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='collection',
+ name='role',
+ field=models.CharField(blank=True, choices=[('', '–'), ('recommend', 'recommended')], db_index=True, max_length=128),
+ ),
+ ]
book_slugs = models.TextField(_('book slugs'))
kind = models.CharField(_('kind'), max_length=10, blank=False, default='book', db_index=True,
choices=(('book', _('book')), ('picture', _('picture'))))
+ role = models.CharField(max_length=128, blank=True, db_index=True, choices=[
+ ('', '–'),
+ ('recommend', _('recommended')),
+ ])
class Meta:
ordering = ('title',)
def collections(request):
- objects = Collection.objects.all()
+ objects = Collection.objects.filter(role='')
if len(objects) > 3:
best = random.sample(list(objects), 3)
except IndexError:
pass
- ctx['best'] = Book.objects.filter(findable=True).order_by('?')[:5]
+ best = []
+ best_places = 5
+ for recommended in Collection.objects.filter(role='recommend').order_by('?'):
+ books = list(recommended.get_books().exclude(id__in=[b.id for b in best]).order_by('?')[:best_places])
+ best.extend(books)
+ best_places -= len(books)
+ if not best_places:
+ break
+ if best_places:
+ best.extend(
+ list(
+ Book.objects.filter(findable=True).exclude(id__in=[b.id for b in best]).order_by('?')[:best_places]
+ )
+ )
+ ctx['best'] = best
return render(request, "main_page.html", ctx)