Editing Python Class in Shell and SQLAlchemy -


I am working on the terminal on a shell script after this tutorial SQLAlchemy tutorial. I need to type

  gt; & Gt; & Gt; Sqlalchemy import column, integer, string & gt; & Gt; & Gt; Class user (base): __tablename__ = 'users' id = column (integer, primary_key = true) name = column (string) absolute name = column (string) password = column (string) def __repr __ (self): return "& lt ; User (name = '% s', absolute name = '% s', password = '% s') & gt; "% (Self.name, self.fullname, self.password)  

After the problem I have typed the password = column (string) I hit twice and changed .... >> I then took everything back but then an error was thrown because the class already exists ... I am not completely sure how to fix it. How do I open that slip in the shell script and edit it (Add DF to DRR)

The error thrown below:

  / user / giripeters / TFSQLLX / Lib / python2.7 / site-packages / sqlalchemy / ext / declarative / clsregistry.py: 160: This declaration base already has a class where __main __ is the same class name and module name as the user Includes. String Lookup Table Existing.Ad_Item (CLS) traceback (most recent call final): File "& lt; stdin>", line 1, & lt; Module & gt; File "/ Users / Garipeters / TFscll Elkia / lib / python2.7 / site-packages / sqlalchemy / ext / declarative / api.py", line 53, in __init _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ {_G _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ / Python 2/7 / site-package / sqlalchemy / sql / schema.py ", in line 339, __new__" existing Lika object. "% Key") sqlalchemy.exc.InvalidRequestError: The table 'User' is already defined for this metadata example. To define options and columns on an existing table object, specify 'extend_existing = True'.  

Close the shell and open again, and then type everything, it To make sure not to enter at this time, not twice.

Alternate Form Whenever you face a blank line - if you press and then press the tab or space, be sure to add indents. The number of the appropriate time, so that you are inducting at the right level, then you enter & gt; & gt; > Should be able to hit.> & Gt; again.

You can re-class the shell Sector should define, so I'm not sure that "was thrown error" - its meaning can be useful if you want to edit your post to include specific stack trace.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

c# - MySQL Parameterized Select Query joining tables issue -