Can you pass along more specifics here?  I don't see where this named tuple is 
being created.  It's true that the ARRAY type by default doesn't know how deep 
it should be unwrapping arrays, if you pass the "dimensions" argument then it 
will be fixed.   But it's not clear why you didn't see this issue in 0.7 as 
well, perhaps we check for a wider range of array/tuple types at this point but 
I don't recall.



On Mar 7, 2013, at 1:21 PM, Jason <[email protected]> wrote:

> Hello,
> 
> I'm using a column defined as:
> discounts = Column(ARRAY(Discount))
> 
> Where Discount is a UserDefinedType that just passes the value through 
> to/from Psycopg2 (which uses a namedtuple for the discounts value):
> 
> class Discount(UserDefinedType):
>     """ SQLAlchemy type that passes through values to be handled by a psycopg2
>         extension type.
>     """
>     type_name = 'Discount'
> 
>     def get_col_spec(self):
>         return self.type_name
> 
>     def bind_processor(self, dialect):
>         return None
> 
>     def result_processor(self, dialect, coltype):
>         return None
> 
>     def is_mutable(self):
>         return True
> 
>     def copy_value(self, value):
>         return copy.copy(value)
> 
> Previously (in 0.7.9) the discounts value on a model instance would be an 
> list of discount types (which are namedtuples). Now SQLAlchemy seems to 
> convert the Discount type into a list resulting in a two-dimensional list for 
> the discounts value instead of a list of namedtuples. The documentation 
> doesn't mention this side-effect of the array improvements, is this a bug in 
> 0.8.0b? 
> 
> Thanks,
> 
> Jason
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to