def get_db_prep_value(self, value, connection=None, prepared=False):
# Casts times into the format expected by the backend
- return value.as_seconds()
+ try:
+ return value.as_seconds()
+ except:
+ return value
def value_to_string(self, obj):
val = self._get_val_from_obj(obj)
{% load telemeta_utils %}
{% block title %}
-<img src="{% url telemeta-images resource.icon %}" style="vertical-align:middle" /> {{ type }} : {% trans "New" %}
+<img src="{% url telemeta-type-images type %}" style="vertical-align:middle" /> {{ type }} : {% trans "New" %}
{% endblock %}
{% block title_buttons %}
{% if resource %}
{% block title %}
- <img src="{% url telemeta-images resource.icon %}" style="vertical-align:middle" />
+ <img src="{% url telemeta-type-images type %}" style="vertical-align:middle" />
{{ type|capitalize }} :
<a href="{% url telemeta-resource-detail type resource.public_id %}">{{ resource.title }}</a>
{% endblock %}
{% load telemeta_utils %}
{% block title %}
-<img src="{% url telemeta-images resource.icon %}" style="vertical-align:middle" /> {{ type }} : {{ resource }}
+<img src="{% url telemeta-type-images type %}" style="vertical-align:middle" /> {{ type }} : {{ resource }}
{% endblock %}
{% block title_buttons %}
<a href="{% url telemeta-resource-detail type resource.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>