mirror of
https://github.com/daniviga/django-ram.git
synced 2025-12-26 15:28:31 +01:00
More UI improvements and fix a regression on manufacturer filtering
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import shutil
|
||||
from urllib.parse import urlparse
|
||||
from django.db import models
|
||||
from django.conf import settings
|
||||
from django.urls import reverse
|
||||
@@ -169,6 +170,7 @@ class Catalog(BaseBook):
|
||||
class Magazine(BaseModel):
|
||||
name = models.CharField(max_length=200)
|
||||
publisher = models.ForeignKey(Publisher, on_delete=models.CASCADE)
|
||||
website = models.URLField(blank=True)
|
||||
ISBN = models.CharField(max_length=17, blank=True) # 13 + dashes
|
||||
image = models.ImageField(
|
||||
blank=True,
|
||||
@@ -205,6 +207,10 @@ class Magazine(BaseModel):
|
||||
kwargs={"uuid": self.uuid}
|
||||
)
|
||||
|
||||
def website_short(self):
|
||||
if self.website:
|
||||
return urlparse(self.website).netloc.replace("www.", "")
|
||||
|
||||
|
||||
class MagazineIssue(BaseBook):
|
||||
magazine = models.ForeignKey(
|
||||
|
||||
Reference in New Issue
Block a user