Open GoogleCodeExporter opened 9 years ago
can you give a real example ? you use options=languages but language is never
defined
here.
I need this to create a unittest to reproduce the problem.
Thanks
Original comment by gael.pas...@gmail.com
on 27 Aug 2009 at 3:37
Here is a full working example that exhibits the problem:
from sqlalchemy import engine, create_engine, Column, String
from formalchemy import *
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Text(Base):
__tablename__ = "texts"
name = Column(String, primary_key=True)
language = Column(String)
engine = create_engine('sqlite:///:memory:')
r = engine.execute("select 'Swedish' as name, 'sv_SE' as iso_code union all
select
'English', 'en_US'").fetchall()
print FieldSet(Text).language.dropdown(options=r).render() #should work, but
gives
value="(u'English', u'en_US')">(u'English', u'en_US')
print FieldSet(Text).language.dropdown(options=map(list, r)).render() # works
correctly
Original comment by joakim.l...@gmail.com
on 28 Aug 2009 at 9:44
It work for me with SQLAlchemy-0.5.5-py2.5
I've added a test for this:
http://code.google.com/p/formalchemy/source/diff?spec=svne95bb449481b2dd7f4fcf8c
89e2a5ad94b960c21&r=e95bb449481b2dd7f4fcf8c89e2a5ad94b960c21&format=side&path=/f
ormalchemy/tests/test_options.py
Original comment by gael.pas...@gmail.com
on 1 Sep 2009 at 2:04
I get the same wrong result with my testcase, even with SQLAlchemy-0.5.5. This
is the
incorrect output from my testcase:
<select id="Text--language" name="Text--language"><option value="(u'Swedish',
u'sv_SE')">(u'Swedish', u'sv_SE')</option>
<option value="(u'English', u'en_US')">(u'English', u'en_US')</option></select>
...and this is how it should look:
<select id="Text--language" name="Text--language"><option
value="sv_SE">Swedish</option>
<option value="en_US">English</option></select>
Original comment by joakim.l...@gmail.com
on 2 Sep 2009 at 8:57
Which version of python / FA ?
Original comment by gael.pas...@gmail.com
on 2 Sep 2009 at 12:25
Original issue reported on code.google.com by
joakim.l...@gmail.com
on 27 Aug 2009 at 3:04