I'm having problems with the tutorial when using ipython (but not when
using the normal python interpreter). I'm using python2.4 on Mac OS X
10.4, with elixir 0.5, and ipython 0.8.2
With a model that contains:
######
from elixir import *
metadata.bind = "sqlite:///movies.sqlite"
metadata.bind.echo = True
class Movie(Entity):
title = Field(Unicode(30))
year = Field(Integer)
description = Field(Unicode)
def __repr__(self):
return '<Movie "%s" (%d)>' % (self.title, self.year)
######
I go to ipython and get:
In [1]: from model import *
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/Users/ed/tg-sites/picard/<ipython console>
/Users/ed/tg-sites/picard/model.py
2
3 metadata.bind = "sqlite:///movies.sqlite"
----> 4 metadata.bind.echo = True
5
6 class Movie(Entity):
AttributeError: 'str' object has no attribute 'echo'
If I comment out the line:
# metadata.bind.echo = True
and then go back to ipython, I get:
In [1]: from model import *
In [2]: setup_all()
ERROR: Internal Python error in the inspect module.
Below is the traceback from this internal error.
Traceback (most recent call last):
File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/ipython-0.8.2-py2.4.egg/IPython/ultraTB.py",
line 576, in text
records = _fixed_getinnerframes(etb, context,self.tb_offset)
File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/ipython-0.8.2-py2.4.egg/IPython/ultraTB.py",
line 203, in _fixed_getinnerframes
records = inspect.getinnerframes(etb, context)
File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/inspect.py",
line 811, in getinnerframes
framelist.append((tb.tb_frame,) + getframeinfo(tb, context))
File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/inspect.py",
line 775, in getframeinfo
lines, lnum = findsource(frame)
File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/inspect.py",
line 437, in findsource
if pat.match(lines[lnum]): break
IndexError: list index out of range
Unfortunately, your original traceback can not be constructed.
I've tried this using sqlite and postgres. Both have the same effects
in ipython, both work fine in the normal python interpreter.
If anyone has any ideas as to what could be wong, I'd be very
grateful, as I'd much rather be using ipython.
Thanks
Ed
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---