Collections, and installer patches

This commit is contained in:
Raelon Masters
2020-03-20 01:15:07 -04:00
parent 746dd405a8
commit 9327b01ff4
263 changed files with 509 additions and 365 deletions

View File

@@ -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