Has anyone else wanted this...
Suppose you could give a *Col an extra parameter as follows...
myfield =3D StringCol(description=3D'human readable description')
This would greatly assist in writing auto-generated admin interfaces for we=
It is easily done, in col.py just add description=3DNone, to the args of=20
SOCol.__init__ and self.description =3D description to the body of that=20
Then find it as mytable.sqlmeta._columnDict['myfield'].description.
What about adding this to the main sources?
Also, when introspecting an SQLObject class, looking at the _joinList is=20
there a standard way of discerning between a MultipleJoin and a RelatedJoin=
The only ways I have thought of are: 1) match against the repr of the join=
object, which seems too much like a hack, 2) Find the otherClass and see if=
it has a ForeignKey pointing back, or 3) check for various attributes, ther=
are some that exist for one type and not the other, this seems quite=20
Again, I ask with auto-gen'd admin interfaces in mind. The two have to be=
handled differently, i.e. in a class instance, it makes sense to add=20
to/remove from a RelatedJoin, whereas a MultipleJoin can only be altered by=
changing another object's ForeignKey!
On Wed, Jul 20, 2005 at 10:57:22AM +0100, John Page wrote:
> myfield = StringCol(description='human readable description')
> This would greatly assist in writing auto-generated admin interfaces for web
Do you have any particular tool in mind?
> there a standard way of discerning between a MultipleJoin and a RelatedJoin?
isinstance(), I suppose.
Oleg Broytmann http://phd.pp.ru/ phd@...
Programmers don't die, they just GOSUB without RETURN.