mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
Add shop as a fixed property (#49)
* Add shop field (from properties) * Update template * Implement description in BaseModel and then consist * Make notes internal only * Fix a merge issue
This commit is contained in:
@@ -276,8 +276,8 @@ class CatalogAdmin(SortableAdminBase, admin.ModelAdmin):
|
||||
"Publication Year",
|
||||
"Description",
|
||||
"Tags",
|
||||
"Purchase Date",
|
||||
"Shop",
|
||||
"Purchase Date",
|
||||
"Price ({})".format(get_site_conf().currency),
|
||||
"Notes",
|
||||
"Properties",
|
||||
|
@@ -5,8 +5,6 @@ from django.conf import settings
|
||||
from django.urls import reverse
|
||||
from django_countries.fields import CountryField
|
||||
|
||||
from tinymce import models as tinymce
|
||||
|
||||
from ram.utils import DeduplicatedStorage
|
||||
from ram.models import BaseModel, Image, Document, PropertyInstance
|
||||
from metadata.models import Scale, Manufacturer, Shop, Tag
|
||||
@@ -48,7 +46,6 @@ class BaseBook(BaseModel):
|
||||
)
|
||||
number_of_pages = models.SmallIntegerField(null=True, blank=True)
|
||||
publication_year = models.SmallIntegerField(null=True, blank=True)
|
||||
description = tinymce.HTMLField(blank=True)
|
||||
shop = models.ForeignKey(
|
||||
Shop, on_delete=models.CASCADE, null=True, blank=True
|
||||
)
|
||||
|
@@ -26,7 +26,12 @@ class BookSerializer(serializers.ModelSerializer):
|
||||
|
||||
class Meta:
|
||||
model = Book
|
||||
exclude = ("shop", "purchase_date", "price",)
|
||||
exclude = (
|
||||
"notes",
|
||||
"shop",
|
||||
"purchase_date",
|
||||
"price",
|
||||
)
|
||||
read_only_fields = ("creation_time", "updated_time")
|
||||
|
||||
|
||||
@@ -37,5 +42,10 @@ class CatalogSerializer(serializers.ModelSerializer):
|
||||
|
||||
class Meta:
|
||||
model = Catalog
|
||||
exclude = ("purchase_date", "price",)
|
||||
exclude = (
|
||||
"notes",
|
||||
"shop",
|
||||
"purchase_date",
|
||||
"price",
|
||||
)
|
||||
read_only_fields = ("creation_time", "updated_time")
|
||||
|
Reference in New Issue
Block a user