Closed baryonyx5 closed 6 years ago
What's your hybrid expression look like?
I used the same code from https://github.com/Pegase745/sqlalchemy-datatables/issues/92
class MyModel(Base):
__tablename__ = 'my_model'
id = Column(Integer, primary_key=True)
first_name = Column(String, nullable=False)
last_name = Column(String, nullable=False)
value = Column(Integer, nullable=False)
@hybrid_property
def full_name(self):
return '%s-%s' % (self.first_name, self.last_name)
I think you should be using column properties. If you really have to use hybrid properties, it has to be valid sql, or you have to separately define the expression, see the sqlalchemy docs
Using a hybrid expression does work and I'm guessing that's the way to go. The ColumnDT docstring and that previous issue refer to hybrid property so I wanted to clarify.
Thanks
I have the same problem and i can't solve it . Can you present the example with the hybrid expression you used ?
First, I thank you for this project as it has worked quite well for me.
I see in the ColumnDT doc string that hybrid properties are valid for the sql expression. I also saw a previous issue (https://github.com/Pegase745/sqlalchemy-datatables/issues/92) that elaborated a bit. I may be missing something but this does not seem to work for me.
I've used the simple model you defined as an example in the linked-to issue
This raise the following:
I'm not sure how this could work unless I'm missing a step or the model requires a hybrid expression
Any clarification would be appreciated.
Thank you