Conversation
luckyasser
commented
Feb 23, 2015
- Change links representation.
- Add sqla extension module.
class Collection(royal.Collection): | ||
sa_model = None | ||
sa_exceptions = None | ||
entity_cls = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ^ doesn't look decent.. But I've tried it with zope interfaces and it doesn't look any prettier too.. Suggestions ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not get what you want to do here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I get it: dependency injection? Should we define a clean interface of sa_model
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's what I did at first.. But why only for sa_model
? what about entity_cls
?
May be we just document the expected injection ?
I used to be a fan of interfaces back in the Java and C++ days, but it doesn't sound like a python thing.. I think if we follow that notion strictly, it'll be tedious and may be unpythonic..?
self.name) | ||
|
||
def on_traversing(self, key): | ||
self.load_entity() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might not want this.
|
||
class Collection(royal.Collection): | ||
|
||
sa_model = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
session = None
|
||
@staticmethod | ||
def flush(): | ||
Session.flush() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat
Please update version number in setup.cfg file. |