Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1144)

Issue 2126043: Add One2One field (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 7 months ago by ced
Modified:
13 years, 4 months ago
Reviewers:
bch, pheller, udono, yangoon1
Visibility:
Public.

Patch Set 1 #

Total comments: 1

Patch Set 2 : Use many2one set API #

Total comments: 1

Patch Set 3 : Fix typo #

Patch Set 4 : Update to trunk #

Patch Set 5 : Fix for nested read #

Patch Set 6 : Remove wrong res modification #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+313 lines, -19 lines) Patch
M doc/ref/models/fields.rst View 1 2 1 chunk +22 lines, -0 lines 0 comments Download
M trytond/model/browse.py View 1 chunk +1 line, -1 line 0 comments Download
M trytond/model/fields/__init__.py View 1 chunk +1 line, -0 lines 0 comments Download
A trytond/model/fields/one2one.py View 1 chunk +48 lines, -0 lines 0 comments Download
M trytond/model/model.py View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M trytond/model/modelsql.py View 1 2 3 4 4 chunks +35 lines, -13 lines 0 comments Download
M trytond/model/modelstorage.py View 5 chunks +10 lines, -4 lines 0 comments Download
M trytond/test/test.py View 1 2 1 chunk +69 lines, -0 lines 2 comments Download
M trytond/tests/test_fields.py View 1 2 3 4 2 chunks +125 lines, -0 lines 0 comments Download

Messages

Total messages: 13
ced
13 years, 7 months ago (2010-09-03 21:53:54 UTC) #1
udono
13 years, 7 months ago (2010-09-04 07:03:23 UTC) #2
yangoon1
13 years, 7 months ago (2010-09-04 17:05:29 UTC) #3
bch
http://codereview.appspot.com/2126043/diff/1/8 File trytond/test/test.py (right): http://codereview.appspot.com/2126043/diff/1/8#newcode389 trytond/test/test.py:389: 'Origin and target must be unique'), If i understand ...
13 years, 7 months ago (2010-09-05 22:18:40 UTC) #4
ced
13 years, 7 months ago (2010-09-06 16:13:18 UTC) #5
udono
http://codereview.appspot.com/2126043/diff/7001/doc/ref/models/fields.rst File doc/ref/models/fields.rst (right): http://codereview.appspot.com/2126043/diff/7001/doc/ref/models/fields.rst#newcode518 doc/ref/models/fields.rst:518: .. method:: Many2Many.get_target(pool) One2One.get_target(pool) ?
13 years, 6 months ago (2010-10-11 22:09:06 UTC) #6
ced
13 years, 6 months ago (2010-10-12 07:58:37 UTC) #7
ced
13 years, 5 months ago (2010-11-13 16:11:31 UTC) #8
ced
13 years, 5 months ago (2010-11-13 21:04:25 UTC) #9
ced
13 years, 5 months ago (2010-11-13 21:05:07 UTC) #10
pheller
http://codereview.appspot.com/2126043/diff/36001/trytond/test/test.py File trytond/test/test.py (right): http://codereview.appspot.com/2126043/diff/36001/trytond/test/test.py#newcode412 trytond/test/test.py:412: origin = fields.Many2One('test.one2one_required', 'Origin') Ok, just now getting around ...
13 years, 5 months ago (2010-11-17 00:49:59 UTC) #11
pheller
Don't think this sent, resending. On 2010/11/17 00:49:59, pheller wrote: > http://codereview.appspot.com/2126043/diff/36001/trytond/test/test.py > File trytond/test/test.py ...
13 years, 5 months ago (2010-11-17 00:52:08 UTC) #12
ced
13 years, 5 months ago (2010-11-17 08:38:07 UTC) #13
http://codereview.appspot.com/2126043/diff/36001/trytond/test/test.py
File trytond/test/test.py (right):

http://codereview.appspot.com/2126043/diff/36001/trytond/test/test.py#newcode412
trytond/test/test.py:412: origin = fields.Many2One('test.one2one_required',
'Origin')
On 2010/11/17 00:50:00, pheller wrote:
> Ok, just now getting around to giving this a try.  At first glance, I'm a bit
> confused.  Given my example (ethernet interfaces can have one other end), I'd
> like to define a model like so:
> 
> 
> class Interface(ModelSQL, ModelView):
>     'Interface'
>     _name = 'imdb.interface'
>     _description = __doc__
>     name = fields.Char('Name')
>     device = fields.Many2One('imdb.device', 'Device')
>     other = fields.One2One('imdb.interface.relation', 'other', 'Other
> Interface')
> Interface()
> 
> So, I guess I have these questions:
> 
> Must I define the "relation" model?

Yes

> Is it possible for the relation model's origin and targets refer to the same
> model?   

Yes
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b