Again I had a look at code, and don't find any way to do it "as is" but maybe it could be done adding a way to define a Entity Class as a base class (the method is_base from entity.py should return true) by this way, we will be able to extend functionality of Entity without lose the current Entity features such as get_by, get and other useful methods, and without need to rewrite the entire Entity Class methods.
I will try to create a patch for this "feature" any suggestion? Att, Alexandre da Silva Analista de Sistemas - Bacharel em Sistemas de Informação (2003-2007) On 8 fev, 10:20, Alexandre da Silva <[EMAIL PROTECTED]> wrote: > Hello all, > > I want/need to create a "base" class that contains some operations and > attributes, and all this attributes need to be inherited by my Entities. > > So I not want to map this class as a Database Table, is just a > "placeholder" for that methods and props. > > Example: > > class MyHelperClass(object): > def some_util_method(self): > return some_useful_result > > class MyDatabaseClass1(MyHelperClass): > pass > > class MyDatabaseClass2(MyHelperClass): > pass > > but, to be created ad database and managed by Elixir/SA my classes needs > to inherit from Entity., if I inherit MyHelperClass from Entity, a table > will be created ad database and all entities will be based on this and > have a foreign key. > > my question. is there a way to inherit from Entity > "MyHelperClass(Entity)" but no setup the database for this? > > I've successfully setup by using multiple inheritance, by this way > "class MyDatabaseClass1(Entity, MyHelperClass)" but I don't know if it > will cause some problem or not. > > Thanks for any help > > Att, > -- > Alexandre da Silva > Analista de Sistemas - Bacharel em Sistemas de Informação (2003-2007) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
