mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
Make purchase date a private field as well
This commit is contained in:
@@ -26,7 +26,7 @@ class BookSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Book
|
model = Book
|
||||||
exclude = ("price",)
|
exclude = ("purchase_date", "price",)
|
||||||
read_only_fields = ("creation_time", "updated_time")
|
read_only_fields = ("creation_time", "updated_time")
|
||||||
|
|
||||||
|
|
||||||
@@ -37,5 +37,5 @@ class CatalogSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Catalog
|
model = Catalog
|
||||||
exclude = ("price",)
|
exclude = ("purchase_date", "price",)
|
||||||
read_only_fields = ("creation_time", "updated_time")
|
read_only_fields = ("creation_time", "updated_time")
|
||||||
|
@@ -108,11 +108,11 @@
|
|||||||
<th scope="row">Publication year</th>
|
<th scope="row">Publication year</th>
|
||||||
<td>{{ book.publication_year|default:"-" }}</td>
|
<td>{{ book.publication_year|default:"-" }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% if request.user.is_staff %}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Purchase date</th>
|
<th scope="row">Purchase date</th>
|
||||||
<td>{{ book.purchase_date|default:"-" }}</td>
|
<td>{{ book.purchase_date|default:"-" }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if request.user.is_staff %}
|
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Price ({{ site_conf.currency }})</th>
|
<th scope="row">Price ({{ site_conf.currency }})</th>
|
||||||
<td>{{ book.price|default:"-" }}</td>
|
<td>{{ book.price|default:"-" }}</td>
|
||||||
|
@@ -182,11 +182,11 @@
|
|||||||
<th scope="row">Production year</th>
|
<th scope="row">Production year</th>
|
||||||
<td>{{ rolling_stock.production_year|default:"-" }}</td>
|
<td>{{ rolling_stock.production_year|default:"-" }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% if request.user.is_staff %}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Purchase date</th>
|
<th scope="row">Purchase date</th>
|
||||||
<td>{{ rolling_stock.purchase_date|default:"-" }}</td>
|
<td>{{ rolling_stock.purchase_date|default:"-" }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if request.user.is_staff %}
|
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Price ({{ site_conf.currency }})</th>
|
<th scope="row">Price ({{ site_conf.currency }})</th>
|
||||||
<td>{{ rolling_stock.price|default:"-" }}</td>
|
<td>{{ rolling_stock.price|default:"-" }}</td>
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
from ram.utils import git_suffix
|
from ram.utils import git_suffix
|
||||||
|
|
||||||
__version__ = "0.15.2"
|
__version__ = "0.15.3"
|
||||||
__version__ += git_suffix(__file__)
|
__version__ += git_suffix(__file__)
|
||||||
|
@@ -28,5 +28,5 @@ class RollingStockSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = RollingStock
|
model = RollingStock
|
||||||
exclude = ("price",)
|
exclude = ("purchase_date", "price",)
|
||||||
read_only_fields = ("creation_time", "updated_time")
|
read_only_fields = ("creation_time", "updated_time")
|
||||||
|
Reference in New Issue
Block a user