Make purchase date a private field as well

This commit is contained in:
2025-01-04 19:06:10 +01:00
parent 8557e2b778
commit 206b9aea57
5 changed files with 6 additions and 6 deletions

View File

@@ -26,7 +26,7 @@ class BookSerializer(serializers.ModelSerializer):
class Meta:
model = Book
exclude = ("price",)
exclude = ("purchase_date", "price",)
read_only_fields = ("creation_time", "updated_time")
@@ -37,5 +37,5 @@ class CatalogSerializer(serializers.ModelSerializer):
class Meta:
model = Catalog
exclude = ("price",)
exclude = ("purchase_date", "price",)
read_only_fields = ("creation_time", "updated_time")

View File

@@ -108,11 +108,11 @@
<th scope="row">Publication year</th>
<td>{{ book.publication_year|default:"-" }}</td>
</tr>
{% if request.user.is_staff %}
<tr>
<th scope="row">Purchase date</th>
<td>{{ book.purchase_date|default:"-" }}</td>
</tr>
{% if request.user.is_staff %}
<tr>
<th scope="row">Price ({{ site_conf.currency }})</th>
<td>{{ book.price|default:"-" }}</td>

View File

@@ -182,11 +182,11 @@
<th scope="row">Production year</th>
<td>{{ rolling_stock.production_year|default:"-" }}</td>
</tr>
{% if request.user.is_staff %}
<tr>
<th scope="row">Purchase date</th>
<td>{{ rolling_stock.purchase_date|default:"-" }}</td>
</tr>
{% if request.user.is_staff %}
<tr>
<th scope="row">Price ({{ site_conf.currency }})</th>
<td>{{ rolling_stock.price|default:"-" }}</td>

View File

@@ -1,4 +1,4 @@
from ram.utils import git_suffix
__version__ = "0.15.2"
__version__ = "0.15.3"
__version__ += git_suffix(__file__)

View File

@@ -28,5 +28,5 @@ class RollingStockSerializer(serializers.ModelSerializer):
class Meta:
model = RollingStock
exclude = ("price",)
exclude = ("purchase_date", "price",)
read_only_fields = ("creation_time", "updated_time")