Collections, and installer patches
0
src/interface/migrations/0001_initial.py
Normal file → Executable file
0
src/interface/migrations/0002_auto_20200101_0445.py
Normal file → Executable file
0
src/interface/migrations/0003_auto_20200101_0447.py
Normal file → Executable file
30
src/interface/migrations/0004_collections.py
Normal file → Executable file
@@ -1,25 +1,37 @@
|
||||
# Generated by Django 3.0.2 on 2020-02-04 20:22
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('interface', '0003_auto_20200101_0447'),
|
||||
("interface", "0003_auto_20200101_0447"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Collections',
|
||||
name="Collections",
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('collection', models.CharField(max_length=255)),
|
||||
('book_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='interface.Books')),
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("collection", models.CharField(max_length=255)),
|
||||
(
|
||||
"book_id",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
to="interface.Books",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'db_table': 'collections',
|
||||
},
|
||||
options={"db_table": "collections",},
|
||||
),
|
||||
]
|
||||
|
||||
@@ -30,12 +30,14 @@ class Books(models.Model):
|
||||
progress = models.IntegerField(null=True)
|
||||
file_name = models.CharField(max_length=255, null=False)
|
||||
|
||||
class Collections(models.Model):
|
||||
|
||||
class Collections(models.Model):
|
||||
class Meta:
|
||||
db_table = "collections"
|
||||
|
||||
def __str__(self):
|
||||
return self.collection
|
||||
|
||||
collection = models.CharField(max_length=255)
|
||||
book_id = models.ForeignKey(Books, on_delete=models.PROTECT)
|
||||
|
||||
@@ -45,9 +47,9 @@ class Collections(models.Model):
|
||||
|
||||
def generic_search(self, query):
|
||||
try:
|
||||
results = Books.objects.annotate(
|
||||
search=SearchVector("author", "title", "file_name"),
|
||||
).filter(search=query)
|
||||
results = Books.objects.annotate(search=SearchVector("collection"),).filter(
|
||||
search=query
|
||||
)
|
||||
except Exception as e:
|
||||
raise
|
||||
return results
|
||||
|
||||
0
src/interface/static/admin/css/autocomplete.css
vendored
Normal file → Executable file
0
src/interface/static/admin/css/base.css
vendored
Normal file → Executable file
0
src/interface/static/admin/css/changelists.css
vendored
Normal file → Executable file
0
src/interface/static/admin/css/dashboard.css
vendored
Normal file → Executable file
0
src/interface/static/admin/css/fonts.css
vendored
Normal file → Executable file
0
src/interface/static/admin/css/forms.css
vendored
Normal file → Executable file
0
src/interface/static/admin/css/login.css
vendored
Normal file → Executable file
0
src/interface/static/admin/css/responsive.css
vendored
Normal file → Executable file
0
src/interface/static/admin/css/responsive_rtl.css
vendored
Normal file → Executable file
0
src/interface/static/admin/css/rtl.css
vendored
Normal file → Executable file
0
src/interface/static/admin/css/vendor/select2/LICENSE-SELECT2.md
vendored
Normal file → Executable file
0
src/interface/static/admin/css/vendor/select2/select2.css
vendored
Normal file → Executable file
0
src/interface/static/admin/css/vendor/select2/select2.min.css
vendored
Normal file → Executable file
0
src/interface/static/admin/css/widgets.css
vendored
Normal file → Executable file
0
src/interface/static/admin/fonts/LICENSE.txt
vendored
Normal file → Executable file
0
src/interface/static/admin/fonts/README.txt
vendored
Normal file → Executable file
0
src/interface/static/admin/fonts/Roboto-Bold-webfont.woff
vendored
Normal file → Executable file
0
src/interface/static/admin/fonts/Roboto-Light-webfont.woff
vendored
Normal file → Executable file
0
src/interface/static/admin/fonts/Roboto-Regular-webfont.woff
vendored
Normal file → Executable file
0
src/interface/static/admin/img/LICENSE
vendored
Normal file → Executable file
0
src/interface/static/admin/img/README.txt
vendored
Normal file → Executable file
0
src/interface/static/admin/img/calendar-icons.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
src/interface/static/admin/img/gis/move_vertex_off.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
src/interface/static/admin/img/gis/move_vertex_on.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
src/interface/static/admin/img/icon-addlink.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 331 B After Width: | Height: | Size: 331 B |
0
src/interface/static/admin/img/icon-alert.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 504 B After Width: | Height: | Size: 504 B |
0
src/interface/static/admin/img/icon-calendar.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
src/interface/static/admin/img/icon-changelink.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 380 B After Width: | Height: | Size: 380 B |
0
src/interface/static/admin/img/icon-clock.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 677 B After Width: | Height: | Size: 677 B |
0
src/interface/static/admin/img/icon-deletelink.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 392 B After Width: | Height: | Size: 392 B |
0
src/interface/static/admin/img/icon-no.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 560 B After Width: | Height: | Size: 560 B |
0
src/interface/static/admin/img/icon-unknown-alt.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 655 B |
0
src/interface/static/admin/img/icon-unknown.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 655 B |
0
src/interface/static/admin/img/icon-viewlink.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 581 B After Width: | Height: | Size: 581 B |
0
src/interface/static/admin/img/icon-yes.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 436 B After Width: | Height: | Size: 436 B |
0
src/interface/static/admin/img/inline-delete.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 560 B After Width: | Height: | Size: 560 B |
0
src/interface/static/admin/img/search.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 458 B After Width: | Height: | Size: 458 B |
0
src/interface/static/admin/img/selector-icons.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
0
src/interface/static/admin/img/sorting-icons.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
src/interface/static/admin/img/tooltag-add.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 331 B After Width: | Height: | Size: 331 B |
0
src/interface/static/admin/img/tooltag-arrowright.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 280 B After Width: | Height: | Size: 280 B |