[tryton-debian-vcs] tryton-proteus branch debian-wheezy-2.2 created. bad01b2cfa8609b320b34d9fea7ce7b80dd50c34
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Wed Nov 27 17:13:09 UTC 2013
The following commit has been merged in the debian-wheezy-2.2 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-proteus.git;a=commitdiff;h=bad01b2cfa8609b320b34d9fea7ce7b80dd50c34
commit bad01b2cfa8609b320b34d9fea7ce7b80dd50c34
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Sat May 4 17:05:15 2013 +0200
Releasing debian version 2.2.4-1.
diff --git a/debian/changelog b/debian/changelog
index ec7fb89..4c5566e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tryton-proteus (2.2.4-1) unstable; urgency=low
+
+ * Merging upstream version 2.2.4.
+ * Updating copyright.
+
+ -- Mathias Behrle <mathiasb at m9s.biz> Sat, 04 May 2013 16:57:35 +0200
+
tryton-proteus (2.2.2-2) unstable; urgency=low
* Updating maintainers field.
commit 26bc7e0960e9171752741a95ed9deaa92110a60c
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Sat May 4 16:50:58 2013 +0200
Updating copyright.
diff --git a/debian/copyright b/debian/copyright
index 92cfa0b..1a829ed 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,8 +1,8 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: *
-Copyright: 2010-2012 Cedric Krier
- 2010-2012 B2CK SPRL
+Copyright: 2010-2013 Cédric Krier
+ 2010-2013 B2CK SPRL
License: LGPL-3+
Files: debian/*
commit 32761461224b53ac5b03d2018090d7bf9220a79f
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Sat May 4 15:49:48 2013 +0200
Merging upstream version 2.2.4.
diff --git a/CHANGELOG b/CHANGELOG
index 6c7f35f..9f81994 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,9 @@
+Version 2.2.4 - 2013-05-02
+* Bug fixes (see mercurial logs for details)
+
+Version 2.2.3 - 2012-09-10
+* Bug fixes (see mercurial logs for details)
+
Version 2.2.2 - 2012-05-07
* Bug fixes (see mercurial logs for details)
diff --git a/COPYRIGHT b/COPYRIGHT
index e792a2c..7e8c156 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,5 +1,5 @@
-Copyright (C) 2010-2012 Cédric Krier.
-Copyright (C) 2010-2012 B2CK SPRL.
+Copyright (C) 2010-2013 Cédric Krier.
+Copyright (C) 2010-2013 B2CK SPRL.
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
diff --git a/PKG-INFO b/PKG-INFO
index 76603a0..ac50280 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: proteus
-Version: 2.2.2
+Version: 2.2.4
Summary: Library to access Tryton server as a client
Home-page: http://www.tryton.org/
Author: B2CK
diff --git a/proteus.egg-info/PKG-INFO b/proteus.egg-info/PKG-INFO
index 76603a0..ac50280 100644
--- a/proteus.egg-info/PKG-INFO
+++ b/proteus.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: proteus
-Version: 2.2.2
+Version: 2.2.4
Summary: Library to access Tryton server as a client
Home-page: http://www.tryton.org/
Author: B2CK
diff --git a/proteus/__init__.py b/proteus/__init__.py
index 24e5ac5..5792ac7 100644
--- a/proteus/__init__.py
+++ b/proteus/__init__.py
@@ -3,14 +3,13 @@
'''
A library to access Tryton's models like a client.
'''
-__version__ = "2.2.2"
+__version__ = "2.2.4"
__all__ = ['Model', 'Wizard']
from types import NoneType
import threading
import datetime
from decimal import Decimal
import proteus.config
-from proteus.pyson import PYSONDecoder
_MODELS = threading.local()
@@ -171,7 +170,8 @@ class Many2OneDescriptor(FieldDescriptor):
value = relation(value)
elif not value:
value = None
- instance._values[self.name] = value
+ if self.name in instance._values:
+ instance._values[self.name] = value
return value
def __set__(self, instance, value):
@@ -521,6 +521,9 @@ class Model(object):
@classmethod
def get(cls, name, config=None):
'Get a class for the named Model'
+ if isinstance(name, unicode):
+ name = name.encode('utf-8')
+
class Spam(Model):
__metaclass__ = MetaModelFactory(name, config=config)()
return Spam
@@ -580,7 +583,7 @@ class Model(object):
'Save the record'
context = self._config.context
if self.id < 0:
- values = self._get_values(fields=self._changed)
+ values = self._get_values()
self.__id = self._proxy.create(values, context)
else:
if not self._changed:
@@ -730,6 +733,8 @@ class Model(object):
def _on_change(self, name):
'Call on_change for field'
+ # Import locally to not break installation
+ from proteus.pyson import PYSONDecoder
definition = self._fields[name]
if definition.get('on_change'):
if isinstance(definition['on_change'], basestring):
commit 4368f7f8588090f7f693442d095c6dbe66eefa86
Author: Daniel Baumann <daniel at debian.org>
Date: Sat Jun 30 17:36:29 2012 +0200
Releasing debian version 2.2.2-2.
diff --git a/debian/changelog b/debian/changelog
index e6ea93b..ec7fb89 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+tryton-proteus (2.2.2-2) unstable; urgency=low
+
+ * Updating maintainers field.
+ * Updating vcs fields.
+ * Switching to xz compression.
+ * Updating to debhelper version 9.
+ * Correcting copyright file to match format version 1.0.
+
+ -- Daniel Baumann <daniel at debian.org> Sat, 30 Jun 2012 17:36:23 +0200
+
tryton-proteus (2.2.2-1) unstable; urgency=low
* Updating to Standards-Version: 3.9.3, no changes needed.
commit 155b3c8846d0c7a418d6a9fd2cf4b6f4ba8dd4b8
Author: Daniel Baumann <daniel at 127011.net>
Date: Sat Jun 30 17:09:54 2012 +0200
Correcting copyright file to match format version 1.0.
diff --git a/debian/copyright b/debian/copyright
index 3ba7c9a..92cfa0b 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,13 +1,12 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: *
-Copyright:
- (C) 2010-2012 Cedric Krier
- (C) 2010-2012 B2CK SPRL
+Copyright: 2010-2012 Cedric Krier
+ 2010-2012 B2CK SPRL
License: LGPL-3+
Files: debian/*
-Copyright: (C) 2011-2012 Mathias Behrle <mathiasb at m9s.biz>
+Copyright: 2011-2012 Mathias Behrle <mathiasb at m9s.biz>
License: GPL-3+
License: LGPL-3+
commit 1ad827ea80f0019575b829ae9ea44ba244bb013f
Author: Daniel Baumann <daniel at 127011.net>
Date: Sat Jun 30 17:09:54 2012 +0200
Updating to debhelper version 9.
diff --git a/debian/compat b/debian/compat
index 45a4fb7..ec63514 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-8
+9
diff --git a/debian/control b/debian/control
index 0a7ab0f..a79fcfa 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at m9s.biz>
Dm-Upload-Allowed: yes
-Build-Depends: debhelper (>= 8), python (>= 2.6.6-3~), python-setuptools
+Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools
Standards-Version: 3.9.3
Homepage: http://www.tryton.org/
Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-proteus.git
commit 63244cf5f0ac07f7f7cae40c57c20843aa8241dd
Author: Daniel Baumann <daniel at 127011.net>
Date: Sat Jun 30 17:09:54 2012 +0200
Switching to xz compression.
diff --git a/debian/rules b/debian/rules
index e32b791..1ae0776 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,3 +7,6 @@ override_dh_auto_clean:
dh_auto_clean
rm -rf *.egg-info
+
+override_dh_builddeb:
+ dh_builddeb -- -Zxz -z9
diff --git a/debian/source/options b/debian/source/options
index d053b65..22a4de9 100644
--- a/debian/source/options
+++ b/debian/source/options
@@ -1,2 +1,2 @@
-compression = gzip
+compression = xz
compression-level = 9
commit 7218d80a3092044589808fd694b9e417fb381f25
Author: Daniel Baumann <daniel at 127011.net>
Date: Sat Jun 30 16:55:07 2012 +0200
Updating vcs fields.
diff --git a/debian/control b/debian/control
index d122204..0a7ab0f 100644
--- a/debian/control
+++ b/debian/control
@@ -7,8 +7,8 @@ Dm-Upload-Allowed: yes
Build-Depends: debhelper (>= 8), python (>= 2.6.6-3~), python-setuptools
Standards-Version: 3.9.3
Homepage: http://www.tryton.org/
-Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-proteus.git
-Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-proteus.git
+Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-proteus.git
+Vcs-Git: git://debian.tryton.org/git/packages/tryton-proteus.git
X-Python-Version: >= 2.6
Package: tryton-proteus
commit a9cd323b3766d09bd0587412e11a82bd17a2497f
Author: Daniel Baumann <daniel at 127011.net>
Date: Sat Jun 30 16:47:48 2012 +0200
Updating maintainers field.
diff --git a/debian/control b/debian/control
index 5caba0a..d122204 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,7 @@
Source: tryton-proteus
Section: python
Priority: optional
-Maintainer: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
+Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at m9s.biz>
Dm-Upload-Allowed: yes
Build-Depends: debhelper (>= 8), python (>= 2.6.6-3~), python-setuptools
commit f737d7dfa6e19b6d6240d3aa87f1117ab42b4649
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Wed May 9 13:13:24 2012 +0200
Releasing debian version 2.2.2-1.
diff --git a/debian/changelog b/debian/changelog
index 115f2d0..e6ea93b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+tryton-proteus (2.2.2-1) unstable; urgency=low
+
+ * Updating to Standards-Version: 3.9.3, no changes needed.
+ * Updating year in copyright.
+ * Adding Format header for DEP5.
+ * Merging upstream version 2.2.2.
+ * Updating years in copyright.
+
+ -- Mathias Behrle <mathiasb at m9s.biz> Wed, 09 May 2012 11:52:40 +0200
+
tryton-proteus (2.2.1-1) unstable; urgency=low
* Merging upstream version 2.2.1.
commit dcf79865592468a8e359f1699e1e66cb5e3649c1
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Wed May 9 11:52:29 2012 +0200
Updating years in copyright.
diff --git a/debian/copyright b/debian/copyright
index 5b70b16..3ba7c9a 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -2,8 +2,8 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: *
Copyright:
- (C) 2010-2011 Cedric Krier
- (C) 2010-2011 B2CK SPRL
+ (C) 2010-2012 Cedric Krier
+ (C) 2010-2012 B2CK SPRL
License: LGPL-3+
Files: debian/*
commit 6d6a08a960a8cfa4ef5de715514126c0af02045f
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Wed May 9 11:47:30 2012 +0200
Merging upstream version 2.2.2.
diff --git a/CHANGELOG b/CHANGELOG
index ff71820..6c7f35f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 2.2.2 - 2012-05-07
+* Bug fixes (see mercurial logs for details)
+
Version 2.2.1 - 2011-12-26
* Bug fixes (see mercurial logs for details)
diff --git a/COPYRIGHT b/COPYRIGHT
index de261a6..e792a2c 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,5 +1,5 @@
-Copyright (C) 2010-2011 Cédric Krier.
-Copyright (C) 2010-2011 B2CK SPRL.
+Copyright (C) 2010-2012 Cédric Krier.
+Copyright (C) 2010-2012 B2CK SPRL.
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
diff --git a/PKG-INFO b/PKG-INFO
index 5737c16..76603a0 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: proteus
-Version: 2.2.1
+Version: 2.2.2
Summary: Library to access Tryton server as a client
Home-page: http://www.tryton.org/
Author: B2CK
diff --git a/proteus.egg-info/PKG-INFO b/proteus.egg-info/PKG-INFO
index 5737c16..76603a0 100644
--- a/proteus.egg-info/PKG-INFO
+++ b/proteus.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: proteus
-Version: 2.2.1
+Version: 2.2.2
Summary: Library to access Tryton server as a client
Home-page: http://www.tryton.org/
Author: B2CK
diff --git a/proteus.egg-info/requires.txt b/proteus.egg-info/requires.txt
index 747ad85..c3bb918 100644
--- a/proteus.egg-info/requires.txt
+++ b/proteus.egg-info/requires.txt
@@ -1,4 +1,4 @@
-
+python-dateutil
[trytond]
trytond >= 2.2, < 2.3
\ No newline at end of file
diff --git a/proteus/__init__.py b/proteus/__init__.py
index f07cd72..24e5ac5 100644
--- a/proteus/__init__.py
+++ b/proteus/__init__.py
@@ -3,7 +3,7 @@
'''
A library to access Tryton's models like a client.
'''
-__version__ = "2.2.1"
+__version__ = "2.2.2"
__all__ = ['Model', 'Wizard']
from types import NoneType
import threading
@@ -486,7 +486,7 @@ class Model(object):
_config = None
_fields = None
- def __init__(self, id=None, **kwargs):
+ def __init__(self, id=None, _default=True, **kwargs):
super(Model, self).__init__()
if id:
assert not kwargs
@@ -498,7 +498,7 @@ class Model(object):
self._parent = None # store the parent record
self._parent_field_name = '' # store the field name in parent record
self._parent_name = '' # store the field name to parent record
- if self.id < 0:
+ if self.id < 0 and _default:
self._default_get()
for field_name, value in kwargs.iteritems():
@@ -691,11 +691,8 @@ class Model(object):
return res
def _on_change_set(self, field, value):
- if self._fields[field]['type'] in ('one2many', 'many2many'):
- if isinstance(value, (list, tuple)):
- self._values[field] = value
- self._changed.add(field)
- return
+ if (self._fields[field]['type'] in ('one2many', 'many2many')
+ and not isinstance(value, (list, tuple))):
to_remove = []
if value and value.get('remove'):
for record_id in value['remove']:
@@ -709,8 +706,10 @@ class Model(object):
for vals in value.get('add', []):
relation = Model.get(self._fields[field]['relation'],
self._config)
- record = relation()
+ record = relation(_default=False)
for i, j in vals.iteritems():
+ if '.' in i:
+ continue
record._values[i] = j
record._changed.add(i)
# append without signal
@@ -721,11 +720,13 @@ class Model(object):
for record in getattr(self, field):
if record.id == vals['id']:
for i, j in vals.iteritems():
+ if '.' in i:
+ continue
record._values[i] = j
record._changed.add(i)
else:
self._values[field] = value
- self._changed.add(field)
+ self._changed.add(field)
def _on_change(self, name):
'Call on_change for field'
diff --git a/proteus/pyson.py b/proteus/pyson.py
index 5eca3cb..45bcbaa 100644
--- a/proteus/pyson.py
+++ b/proteus/pyson.py
@@ -8,6 +8,7 @@ if sys.version_info < (2, 6):
else:
import json
import datetime
+from dateutil.relativedelta import relativedelta
class PYSON(object):
@@ -396,23 +397,14 @@ class Date(PYSON):
@staticmethod
def eval(dct, context):
- date = datetime.date.today()
- replace = {}
- for i, j in (('y', 'year'), ('M', 'month'), ('d', 'day')):
- if dct[i] is not None:
- replace[j] = dct[i]
- date = date.replace(**replace)
- if dct['dy']:
- year = date.year + dct['dy']
- date = date.replace(year=year)
- if dct['dM']:
- month = date.month + dct['dM']
- year = date.year + month / 12
- month = month % 12
- date = date.replace(year=year, month=month)
- if dct['dd']:
- date += datetime.timedelta(days=dct['dd'])
- return date
+ return datetime.date.today() + relativedelta(
+ year=dct['y'],
+ month=dct['M'],
+ day=dct['d'],
+ years=dct['dy'],
+ months=dct['dM'],
+ days=dct['dd'],
+ )
class DateTime(Date):
@@ -460,22 +452,23 @@ class DateTime(Date):
@staticmethod
def eval(dct, context):
- date = Date.eval(dct, context)
- datetime_ = datetime.datetime.combine(date,
- datetime.datetime.now().time())
- replace = {}
- for i, j in (('h', 'hour'), ('m', 'minute'), ('s', 'second'),
- ('ms', 'microsecond')):
- if dct[i] is not None:
- replace[j] = dct[i]
- datetime_ = datetime_.replace(**replace)
- delta = {}
- for i, j in (('dh', 'hours'), ('dm', 'minutes'), ('ds', 'seconds'),
- ('dms', 'microseconds')):
- if dct[i]:
- delta[j] = dct[i]
- datetime_ += datetime.timedelta(**delta)
- return datetime_
+ return datetime.datetime.now() + relativedelta(
+ year=dct['y'],
+ month=dct['M'],
+ day=dct['d'],
+ hour=dct['h'],
+ minute=dct['m'],
+ second=dct['s'],
+ microsecond=dct['ms'],
+ years=dct['dy'],
+ months=dct['dM'],
+ days=dct['dd'],
+ hours=dct['dh'],
+ minutes=dct['dm'],
+ seconds=dct['ds'],
+ microseconds=dct['dms'],
+ )
+
CONTEXT = {
'Eval': Eval,
diff --git a/setup.py b/setup.py
index 4d1e957..b9348d5 100644
--- a/setup.py
+++ b/setup.py
@@ -36,6 +36,9 @@ setup(name='proteus',
'Topic :: Office/Business',
],
license='LGPL-3',
+ install_requires=[
+ "python-dateutil",
+ ],
extras_require={
'trytond': ['trytond >= %s.%s, < %s.%s' %
(major_version, minor_version, major_version, minor_version + 1)],
--
tryton-proteus
More information about the tryton-debian-vcs
mailing list