Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #93 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

[PATCH] Add support for singleJoins (CatWalk)

Reported by: Ronald Owned by: Chad Crabtree
Priority: high Milestone: 0.9
Component: Toolbox Version:
Severity: normal Keywords: CatWalk JavaScript develix
Cc:

Description

Pretty much like MultipleJoins?

Attachments

__init__.patch Download (2.0 KB) - added by Joost@… 13 years ago.
Makes SingleJoin? behave as a ForeignKey/MultipleJoin? mixup
catwalk.patch Download (742 bytes) - added by Joost 13 years ago.
Makes SingleJoin? behave as a ForeignKey/MultipleJoin? mixup
__init__.2.patch Download (2.1 KB) - added by joost 13 years ago.
added and try: except: block to the patch. should be fine now

Change History

comment:1 Changed 13 years ago by anonymous

  • Summary changed from Support for singleJoins to Add support for singleJoins

comment:2 Changed 13 years ago by anonymous

  • Summary changed from Add support for singleJoins to Add support for singleJoins (CatWalk)

comment:3 Changed 13 years ago by Ronald Jaramillo

  • Owner changed from Ronald to Chad Crabtree

The user case model for it looks like this:

class Client(SQLObject):
	name=StringCol(length=200)
	PhysicalAddress=SingleJoin('Address')
        ShippingAddress=SingleJoin('Address')

class Address(SQLObject):
	client=ForeignKey('Client',default=None)
        street=StringCol(length=200)
        zip=StreetCol(length=200)

Single Joins should work almost like MultipleJoins, for the different views the expected functionality goes like this:

Add and Edit view

SingleJoins are not shown (MultipleJoins nor RelatedJoins are shown either)

Preview view (if the client allready has single joins)

name: Chad Crabtree

PhysicalAddress:

streetzip
henriksvej2400

ShippingAddress:

streetzip
holmegard1400

[ Cancel ] [ Edit ]

The columns to be shown should be configurable as for MultipleJoins and RelatedJoins

Preview view (no single join)

name : Chad Crabtree
PhysicalAddress: + Add Single Join
ShippingAddress + Add Single Join

[ Cancel ] [ Edit ]

Clicking 'Add Single Join' will send the user to the Add View for 'Address', ideally the foreignKey 'client' will default to 'Chad Crabtree'

Browse View

The grid view for Client is a bit complicated

Name PhysicalAddress ShippingAddress
Chad Crabtree street: henriksvej
zip:2400
street: holmegard
zip:1400

The fields shown for the single joins are the ones selected by the user in the preview for the Client object

comment:4 Changed 13 years ago by anonymous

  • Component changed from TurboGears to Toolbox

comment:5 Changed 13 years ago by anonymous

  • Type changed from defect to enhancement

Is'nt this an enhancement?

comment:6 Changed 13 years ago by florian

On r441 there is still a problem with that.

The SingleJoin? field is interpreted as a text-field, the subsequent try to insert in the Add dialog leads to

192.168.1.50 - - [2006/01/04 18:47:51] "GET /catwalk/columns?objectName=product HTTP/1.1" 200 759
2006/01/04 18:47:57 HTTP INFO 192.168.1.50 - POST /catwalk/add HTTP/1.1
2006/01/04 18:47:57  INFO Traceback (most recent call last):
  File "/usr/local/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py", line 271, in run
    main()
  File "/usr/local/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py", line 502, in main
    body = page_handler(*args, **cherrypy.request.paramMap)
  File "turbogears/controllers.py", line 242, in newfunc
  File "turbogears/database.py", line 189, in run_with_transaction
  File "turbogears/controllers.py", line 259, in _execute_func
  File "/projects/turbogears/turbogears/toolbox/catwalk/__init__.py", line 733, in add
    new_object = obj(**params)
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py", line 1183, in __init__
    self._create(id, **kw)
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/inheritance/__init__.py", line 218, in _create
    super(InheritableSQLObject, self)._create(id, **kw)
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py", line 1207, in _create
    self.set(**kw)
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py", line 1084, in set
    raise AttributeError, '%s (with attribute %r)' % (e, name)
AttributeError: can't set attribute (with attribute 'offer')

comment:7 Changed 13 years ago by florian

  • Priority changed from normal to high
  • Type changed from enhancement to defect

Assuming this is now somewhat implemented but still buggy I change the state.

comment:8 Changed 13 years ago by kevin

  • Keywords develix added

Changed 13 years ago by Joost@…

Makes SingleJoin? behave as a ForeignKey/MultipleJoin? mixup

Changed 13 years ago by Joost

Makes SingleJoin? behave as a ForeignKey/MultipleJoin? mixup

comment:9 Changed 13 years ago by Joost

This is a (monky)patch which makes singlejoins behave somewhat as foreignkeys/ multiplejoins. You might want to check it out.. Anyway I hope this is the correct way to submit these things.

Changed 13 years ago by joost

added and try: except: block to the patch. should be fine now

comment:10 Changed 13 years ago by kevin

  • Summary changed from Add support for singleJoins (CatWalk) to [PATCH] Add support for singleJoins (CatWalk)

comment:11 Changed 13 years ago by ronald@…

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r565, thanks for the patch Joost!

Note: See TracTickets for help on using tickets.