BORHANUDDIN1 / webapp-improved

Automatically exported from code.google.com/p/webapp-improved
Other
0 stars 0 forks source link

Loop in Jinja sometimes shows the b_val value instead of the _BaseValue class itself #67

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a custom property
class StringProperty(ndb.StringProperty):
    pass

2. Create a test model
class Test(ndb.Model):
    url_name = properties.StringProperty(verbose_name="url")
    name = properties.StringProperty(verbose_name="name")

3. Create an instance in the datastore
t = Test()
t.url_name = "q"
t.name = "a"
t.put()

4. Print the values using python and using jinja2
In python console using:
logging.info(t._values)

output (as expected):
{'url_name': _BaseValue('q'), 'name': _BaseValue('a')}

In jinja2 using:
{{ t._values }}

output:
{'url_name': u'q', 'name_aaaaaaa': _BaseValue('a')}

What version of the product are you using? On what operating system?
Using google appengine 1.7.2
Xubuntu 12.04
Google Chrome

Please provide any additional information below.
As far as I know the bug occurs on random properties

Original issue reported on code.google.com by remcohaszing on 3 Oct 2012 at 12:32