query from sqlalchemy returns AttributeError: 'NoneType' object

MRAB python at mrabarnett.plus.com
Thu May 2 19:17:41 EDT 2013


On 02/05/2013 23:14, karthik.sharma at gmail.com wrote:
[snip]
>
>      ########################################################################
>      class SourcetoPort(Base):
>          """"""
>          __tablename__ = 'source_to_port'
>          id = Column(Integer, primary_key=True)
>          port_no        = Column(Integer)
>          src_address    = Column(String,index=True)
>
>          #----------------------------------------------------------------------
>          def __init__(self, src_address,port_no):
>              """"""
>              self.src_address = src_address

The indentation of this line looks wrong:

>      	   self.port_no     = port_no
>
>      ########################################################################
[snip]




More information about the Python-list mailing list