I tried to submit a Trac ticket on this, but apparently you have to
log in first to submit new tickets, and I honestly can't find a link
to register a password with the site.

Anyway, with Elixir 0.4, there is a very strange broken interaction
with zope.interfaces.  I haven't debugged this enough to know where
the problem lies, but the same code worked with Elixir 0.3 so I'm
guessing the new metaclass stuff in 0.4 broke this.  Here's a boiled
down example.

-----snip snip-----
from zope.interface import implements, Interface, Attribute

class MyInterface(Interface):
    my_attribute = Attribute('my attribute')

from elixir import *
import sqlalchemy

class My(Entity):
    implements(MyInterface)

    my_attribute = Field(Unicode)
    yours = ManyToOne('My')

    def __init__(self, what):
        super(My, self).__init__()
        my_attribute = what.lower()

class Your(Entity):
    #__provides__ = False

    your_attribute = Field(Unicode)

options_defaults['autosetup'] = False
engine = sqlalchemy.create_engine('sqlite:////tmp/foo.db')
metadata.bind = engine
setup_all()
create_all()
-----snip snip-----

% python2.5 foo.py
Traceback (most recent call last):
  File "/tmp/foo.py", line 30, in <module>
    setup_all()
  File "/usr/local/lib/python2.5/site-packages/PIL/__init__.py", line
114, in setup_all

  File "/Users/barry/projects/mailman/3.0/staging/Elixir-0.4.0-
py2.5.egg/elixir/entity.py", line 739, in setup_entities
  File "/Users/barry/projects/mailman/3.0/staging/Elixir-0.4.0-
py2.5.egg/elixir/entity.py", line 317, in setup_events
  File "/usr/local/lib/python2.5/inspect.py", line 208, in getmembers
    results.append((key, value))
AttributeError: __provides__


If you uncomment the __provides__ bogosity in class Your, you get no
exception.  I have no idea why that PIL frame is in the traceback, but
that seems consistent.  It might even be a clue <wink>.

-Barry


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to