[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] dip design questions?
From:       John Fabiani <johnf () jfcomputer ! com>
Date:       2014-01-23 16:31:32
Message-ID: 52E143E4.2000309 () jfcomputer ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,
I believe I'm getting a handle on using dip with sqlalchemy - thanks for 
the SQLA adapters.

Questions:
When using the declarative view is there a way not to use a spinbox for 
integers?
Does the 'Grid' work?  I'm not providing the traceback because it's 
likely I'm doing something wrong.

Error with Floats:
Even after providing a type_map in sqla_imodeltype_adapter.py I get an 
error (see below).  Would you take the time to explain what I need to do.

I added the following :

     # The map of the types used to handle each supported SQLAlchemy 
type.  Note
     # that the order might be important so we don't use a dict.
     # FIXME: Add support for more types.
     _type_map = (
         (SQLA_Boolean, Bool),
         (SQLA_Integer, Int),
         (SQLA_String,  Str),
#
         (SQLA_Float, Float),
         (SQLA_Enum, Enum),
     )

The error:

File "/home/johnf/Dip/dip/temp1.py", line 25, in <module>
class ReceiptHist(Base):
File "/home/johnf/Dip/dip/temp1.py", line 32, in ReceiptHist
recv_freight = Column(Float)
File 
"/usr/lib64/python3.3/site-packages/SQLAlchemy-0.9.1-py3.3-linux-x86_64.egg/sqlalchemy/sql/schema.py", 
line 1042, in __init__
self._init_items(*args)
File 
"/usr/lib64/python3.3/site-packages/SQLAlchemy-0.9.1-py3.3-linux-x86_64.egg/sqlalchemy/sql/schema.py", 
line 79, in _init_items
item._set_parent_with_dispatch(self)

builtins.AttributeError: type object 'Float' has no attribute 
'_set_parent_with_dispatch'



Johnf

[Attachment #5 (text/html)]

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi,<br>
    I believe I'm getting a handle on using dip with sqlalchemy - thanks
    for the SQLA adapters.<br>
    <br>
    Questions:<br>
    When using the declarative view is there a way not to use a spinbox
    for integers?<br>
    Does the 'Grid' work?&nbsp; I'm not providing the traceback because it's
    likely I'm doing something wrong.<br>
    <br>
    Error with Floats:<br>
    Even after providing a type_map in sqla_imodeltype_adapter.py I get
    an error (see below).&nbsp; Would you take the time to explain what I
    need to do. <br>
    <br>
    I added the following :<br>
    <br>
    &nbsp;&nbsp;&nbsp; # The map of the types used to handle each supported \
SQLAlchemy  type.&nbsp; Note<br>
    &nbsp;&nbsp;&nbsp; # that the order might be important so we don't use a \
dict.<br>  &nbsp;&nbsp;&nbsp; # FIXME: Add support for more types.<br>
    &nbsp;&nbsp;&nbsp; _type_map = (<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SQLA_Boolean, Bool),<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SQLA_Integer, Int),<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SQLA_String,&nbsp; Str),<br>
    #<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SQLA_Float, Float),<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SQLA_Enum, Enum),<br>
    &nbsp;&nbsp;&nbsp; )<br>
    <br>
    The error:<br>
    <br>
    <meta name="qrichtext" content="1">
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; \
                text-indent:0px;"><!--StartFragment-->File&nbsp;<span
        style=" font-weight:600; \
                color:#000066;">"/home/johnf/Dip/dip/temp1.py"</span>,
      line 25, in <span style=" font-weight:600; \
                color:#227722;">&lt;module&gt;</span><br>
      &nbsp;&nbsp;<span style=" font-style:italic;">class \
                ReceiptHist(Base):</span><br>
      File&nbsp;<span style=" font-weight:600; \
                color:#000066;">"/home/johnf/Dip/dip/temp1.py"</span>,
      line 32, in <span style=" font-weight:600; \
                color:#227722;">ReceiptHist</span><br>
      &nbsp;&nbsp;<span style=" font-style:italic;">recv_freight = \
Column(Float)</span><br>  File&nbsp;<span style=" font-weight:600; \
color:#000066;">"/usr/lib64/python3.3/site-packages/SQLAlchemy-0.9.1-py3.3-linux-x86_64.egg/sqlalchemy/sql/schema.py"</span>,
                
      line 1042, in <span style=" font-weight:600; \
                color:#227722;">__init__</span><br>
      &nbsp;&nbsp;<span style=" \
font-style:italic;">self._init_items(*args)</span><br>  File&nbsp;<span style=" \
font-weight:600; color:#000066;">"/usr/lib64/python3.3/site-packages/SQLAlchemy-0.9.1-py3.3-linux-x86_64.egg/sqlalchemy/sql/schema.py"</span>,
                
      line 79, in <span style=" font-weight:600; \
                color:#227722;">_init_items</span><br>
      &nbsp;&nbsp;<span style=" \
font-style:italic;">item._set_parent_with_dispatch(self)</span><br>  <br>
      <span style=" font-size:large; font-weight:600; \
                color:#000066;">builtins.AttributeError:
        type object 'Float' has no attribute '_set_parent_with_dispatch'<br>
      </span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-size:large; font-weight:600; color:#000066;"><br>
      </span><!--EndFragment--></p>
    <meta http-equiv="Content-Type" content="text/html;
      charset=ISO-8859-1">
    <style type="text/css">
p, li { white-space: pre-wrap; }
</style><br>
    Johnf<br>
  </body>
</html>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic