]> git.parisson.com Git - telemeta.git/commitdiff
bugfixes
authoryomguy <yomguy@parisson.com>
Mon, 6 Feb 2012 13:59:44 +0000 (14:59 +0100)
committeryomguy <yomguy@parisson.com>
Mon, 6 Feb 2012 13:59:44 +0000 (14:59 +0100)
telemeta/models/core.py
telemeta/templates/telemeta/resource_add.html
telemeta/templates/telemeta/resource_detail.html
telemeta/templates/telemeta/resource_edit.html

index e4b581ad7bce762b367b283aad55f32ca97dfc94..e5a2078e5d2134cc8b5697de00a485a6e7b5799e 100644 (file)
@@ -180,7 +180,10 @@ class DurationField(models.Field):
 
     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)
index 509ef2aaca6f2e361cafc7f64f7ee673fd5c478f..8d74917a2a9d7c520cec20ba0e1eb49e91f7356b 100644 (file)
@@ -3,7 +3,7 @@
 {% 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 %}
index d2ea86502a9c53715374f39fb7af35eb07eb0e10..5f07ab7ad0979f918cac452c79dda20d104a3fda 100644 (file)
@@ -10,7 +10,7 @@
 {% 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 %}
index d64d6ae3efa38ca7704ce509cc5ad8913910960b..4ddbd7f6aa46082aadb409396010f79edc38dbc9 100644 (file)
@@ -3,7 +3,7 @@
 {% 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>