Ticket #71 (new defect)

Opened 5 years ago

Last modified 5 years ago

Property on primary key causes exception

Reported by: guest Owned by:
Priority: normal Milestone:
Component: core Version: 0.6.1
Keywords: Cc:

Description

from elixir import *

class Thing(Entity):
        _name = Field(Unicode, primary_key=True, colname='name')
        
        def _get_name(self):
                return self._name
        
        def _set_name(self, name):
                self._name = name
        
        name = property(_get_name, _set_name)

setup_all()
Traceback (most recent call last):
  File "test", line 14, in <module>
    setup_all()
  File "Elixir-0.6.1-py2.5.egg/elixir/__init__.py", line 145, in setup_all
    setup_entities(entities)
  File "Elixir-0.6.1-py2.5.egg/elixir/entity.py", line 816, in setup_entities
    method()
  File "Elixir-0.6.1-py2.5.egg/elixir/entity.py", line 412, in setup_mapper
    *args, **kwargs)
  File "SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/scoping.py", line 73, in mapper
    return mapper(*args, **kwargs)
  File "SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/__init__.py", line 670, in mapper
    return Mapper(class_, local_table, *args, **params)
  File "SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/mapper.py", line 197, in __init__
    self.__compile_pks()
  File "SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/mapper.py", line 539, in __compile_pks
    raise sa_exc.ArgumentError("Mapper %s could not assemble any primary key columns for mapped table '%s'" % (self, self.mapped_table.description))
sqlalchemy.exc.ArgumentError: Mapper Mapper|Thing|__main___thing could not assemble any primary key columns for mapped table '__main___thing'

Change History

Changed 5 years ago by ged

Forwarded to SA trac as: http://www.sqlalchemy.org/trac/ticket/1166

It might be refused in SA. In which case, we'll have to fix the issue on Elixir side.

Note: See TracTickets for help on using tickets.