From 22177027c0fba5d7b93e48fd4cea5b226015715c Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Wed, 12 Sep 2012 11:02:38 +0200 Subject: [PATCH 1/3] provide a second field for additional cost --- commerce/interfaces.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commerce/interfaces.py b/commerce/interfaces.py index 019a28a..8ced6c9 100644 --- a/commerce/interfaces.py +++ b/commerce/interfaces.py @@ -1,6 +1,6 @@ #-*- coding: UTF-8 -*- # -# Copyright (c) 2011 Helmut Merz helmutm@cy55.de +# Copyright (c) 2012 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,8 +19,6 @@ """ Interfaces for the commerce domain like products, customers, orders, ... - -$Id$ """ from zope import schema @@ -381,6 +379,8 @@ class IOrder(Interface): shippingCost = Attribute(u'The cost to be applied for shipping.') additionalCost = Attribute(u'An additional value to be added to the ' u'net value of the order.') + additionalCost2 = Attribute(u'A second additional value to be added to ' + u'the net value of the order.') tax = Attribute(u'The tax value to be added to the net value of the order.') total = Attribute(u'The total gross value (Decimal) of the order.') From a577b6cbf4e2375fa90c2b168c0b3f1aa3f67591 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Sat, 15 Sep 2012 10:55:11 +0200 Subject: [PATCH 2/3] allow 'width' attribute when sanitizing HTML code --- util/html.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/html.py b/util/html.py index 69aade7..035da0e 100644 --- a/util/html.py +++ b/util/html.py @@ -28,8 +28,8 @@ from cybertools.text.lib.BeautifulSoup import Declaration, NavigableString validTags = ('a b br div em font h1 h2 h3 i li ol p pre span strong ' 'table td tr u ul').split() -validAttrs = ('align border cellpadding cellspacing class colspan href rowspan ' - 'style title').split() +validAttrs = ('align border cellpadding cellspacing class colspan ' + 'href rowspan style title width').split() validStyles = 'font-style font-weight'.split() validStyleParts = 'border padding'.split() From 808103ac780f52ac6af1d81af27160fb57d4e4d6 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Mon, 8 Oct 2012 11:47:38 +0200 Subject: [PATCH 3/3] add conversion of date to integer timestamp --- util/date.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/date.py b/util/date.py index e05b89b..0d112a7 100644 --- a/util/date.py +++ b/util/date.py @@ -27,6 +27,9 @@ from datetime import datetime def getTimeStamp(): return int(time.time()) +def date2TimeStamp(d): + return int(time.mktime(d.timetuple())) + def timeStamp2Date(ts, useGM=False): if ts is None: