pombreda / formalchemy

Automatically exported from code.google.com/p/formalchemy
MIT License
0 stars 0 forks source link

Custom types with inheritance = random renderer #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a custom type
2. Create a custom type that inherit from the custom type in 1
3. Create a renderer for both types
4. ???
5. Render both fields

Expected:
2 different fields

Got:
2 different fields or 2 samefields.

The _get_renderer doesn't look for inheritance but just for isinstance,

I wrote a patch that make it possible to accurately find the good renderer
for each types.

Original issue reported on code.google.com by lamers...@gmail.com on 28 Apr 2009 at 9:59

Attachments:

GoogleCodeExporter commented 9 years ago
style note: `object` is a built in type to python, avoid using this as a 
variable name

I don't like adding the redundant types, certainly TIMESTAMP is not needed b/c 
we
have DateTime; I'm a little fuzzier on which of the text types we need but I 
thought
everything should be a String these days.

Original comment by jbel...@gmail.com on 30 Apr 2009 at 9:19

GoogleCodeExporter commented 9 years ago
If you remove the TIMESTAMP, the test won't pass, that's why I added those 
types.
Otherwise I would keep the other type as they are except unicode may be.

Original comment by lamers...@gmail.com on 1 May 2009 at 1:18

GoogleCodeExporter commented 9 years ago
The given patch does not meet my standards and I'm interested enough in 
supporting
inheritance to fix it myself.  Feel free to reopen with a new patch.

Original comment by jbel...@gmail.com on 16 Jun 2009 at 5:08