Using this code snippet I think I have found the problem. It looks like you need a primary key that's an Integer in order for sprox.dojo.formbase to work proper.
Testing snip code
from sprox.dojo.formbase import DojoEditableForm
from formencode import Schema
from formencode.validators import FieldsMatch
from techs.model import DBSession, OptoutEmail, User, Bob
class Form(DojoEditableForm):
__model__ = Bob
edit_form = Form()
print edit_form()
Schema of table, email (varchar) is the primary key:
$ sqlite3 devdata.db
sqlite> .schema bob
CREATE TABLE bob (
email varchar(255) not null,
primary key (email)
);
The model snippet
class Bob(DeclarativeBase):
__tablename__ = 'bob'
email = Column(String(100), primary_key=True)
Output snippet, textfield is disabled
<input type="text" name="email" class="textfield required" id="email" value=""
disabled="disabled"/>
Same test code with Bob2
Schema of table, email_id (Integer) is the primary key:
$ sqlite3 devdata.db
sqlite> .schema bob2
CREATE TABLE bob2 (
email_id integer not null,
email varchar(255) not null,
primary key (email_id)
);
The model snippet:
class Bob2(DeclarativeBase):
__tablename__ = 'bob2'
email_id = Column(Integer, primary_key=True)
email = Column(String(100))
Output snippet, textfield is enabled
<input type="text" name="email" class="textfield" id="email" value=""/>
My guess is the primary key should not be changed? Cannot be changed? The
sqlgrey project isn't using "proper" database design?
--
Bob Tanner <[email protected]> | Phone : 952-943-8700
http://www.real-time.com, Linux, OSX, VMware | Fax : 952-943-8500
Key fingerprint = F785 DDFC CF94 7CE8 AA87 3A9D 3895 26F1 0DDB E378
PGP.sig
Description: This is a digitally signed message part

