Browse Source

added date formatting

php2python
Holger Frey 7 years ago
parent
commit
880416ade6
  1. 7
      ordr2/models/orders.py
  2. 2
      ordr2/templates/orders/delete.jinja2
  3. 2
      ordr2/templates/orders/edit_multiple_stati.jinja2
  4. 2
      ordr2/templates/orders/list.jinja2

7
ordr2/models/orders.py

@ -107,9 +107,12 @@ class Order(Base):
return '' return ''
if some_one: if some_one:
# in the new system a status change also stores the purchaser # in the new system a status change also stores the purchaser
return '{!s} by {!s}'.format(some_date, some_one) return '{!s} by {!s}'.format(
some_date.strftime('%Y-%m-%d %H:%M'),
some_one
)
# historical data does not have a purchaser associated with a date # historical data does not have a purchaser associated with a date
return '{!s}'.format(some_date) return '{!s}'.format(some_date.strftime('%Y-%m-%d %H:%M'))
@property @property
def placed(self): def placed(self):

2
ordr2/templates/orders/delete.jinja2

@ -37,7 +37,7 @@
<tr> <tr>
<td> <td>
<input type="hidden" name="order" value="{{ order.id }}"> <input type="hidden" name="order" value="{{ order.id }}">
{{ order.created_date }} {{ order.created_date.strftime('%Y-%m-%d %H:%M') }}
</td> </td>
<td>{{ order.cas_description }} </td> <td>{{ order.cas_description }} </td>
<td>{{ order.vendor }} </td> <td>{{ order.vendor }} </td>

2
ordr2/templates/orders/edit_multiple_stati.jinja2

@ -35,7 +35,7 @@
<tbody> <tbody>
{% for order in orders %} {% for order in orders %}
<tr> <tr>
<td>{{ order.created_date }}</td> <td>{{ order.created_date.strftime('%Y-%m-%d %H:%M') }}</td>
<td>{{ order.cas_description }} </td> <td>{{ order.cas_description }} </td>
<td>{{ order.vendor }} </td> <td>{{ order.vendor }} </td>
<td>{{ order.created_by }} </td> <td>{{ order.created_by }} </td>

2
ordr2/templates/orders/list.jinja2

@ -83,7 +83,7 @@
<input type="checkbox" name="marked" value="{{ order.model.id }}"> <input type="checkbox" name="marked" value="{{ order.model.id }}">
</td> </td>
{% endif %} {% endif %}
<td class="column-created">{{ order.model.created_date }}</td> <td class="column-created">{{ order.model.created_date.strftime('%Y-%m-%d %H:%M') }}</td>
<td class="column-cas">{{ order.model.cas_description }}</td> <td class="column-cas">{{ order.model.cas_description }}</td>
<td class="column-vendor">{{ order.model.vendor }}</td> <td class="column-vendor">{{ order.model.vendor }}</td>
<td class="column-catalog">{{ order.model.catalog_nr }}</td> <td class="column-catalog">{{ order.model.catalog_nr }}</td>