Changeset 71


Ignore:
Timestamp:
Jun 2, 2009, 2:32:58 PM (11 years ago)
Author:
marchulsman
Message:

Solving couple of bugs

Location:
container
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • container/postgres.py

    r69 r71  
    240240        res = None #set to primary key if generated
    241241        if(isinstance(seq,container.Container)):
    242             fields = seq._fields.name
     242            fields = seq._activefields.name
    243243            ndata = numpy.empty((seq.nrow,len(self._activefields)),dtype=object)
    244244            data = seq()
     
    252252                        for i in range(seq.nrow):
    253253                            ndata[i,lpos] = d.next()
    254                         res = user_if.vector(ndata[:,lpos],fieldnames=[field.name],fieldtypes=[field.type])
     254                        res = user_if.vector(ndata[:,lpos],fieldname=field.name,fieldtype=str(field.type))
    255255                    elif(d is itypes_py.NotNull):
    256256                        raise RuntimeError, "Field %s should be given" % field.name
  • container/user_if.py

    r42 r71  
    8080    #create fields
    8181    defval = itypes_py.to_defval(fieldtype)
    82     fields = itypes_py.createFields(fieldname,fieldtype,defval)
     82    fields = itypes_py.createFields([fieldname],[fieldtype],[defval])
    8383
    8484    #transform data to internally used column based form
     
    8686        if(isinstance(data,numpy.ndarray)):
    8787            assert (len(data.shape)==1), "Only one dimensional numpy arrays supported"
    88             data = (numpy.cast[itypes_py.to_numpy(fieldtype)](data).view(xnumpy.XArray))
     88            data = (numpy.cast[itypes_py.to_numpy(fieldtype)](data).view(xnumpy.XArray),)
    8989        elif(isinstance(data,(list,tuple))):
    9090            data = (xnumpy.dimarray(data,itypes_py.to_numpy(fieldtype)),)
Note: See TracChangeset for help on using the changeset viewer.