Hi
I'm using latest sqlalchemy with an Oracle db backend.
I have a Date column which presents a *Gregorian date* in db. but i want to 
query my table by a *Jalali date*.
So the hybrid_property to convert gregorian date into jalali date should be 
like this, i think:
@hybrid_property
    def jalali_date(self):
        return jdatetime.date.fromgregorian(year=self.input_date.year,
                                            month=self.input_date,
                                            day=self.input_date.day)


i've tried different ways, but all of them ends with errors like:
AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' 
object associated with MeasureData.input_date has an attribute 'year'
or
TypeError: an integer is required (got type InstrumentedAttribute)

So i guess i have to get access to *instance value* of 
*MeasureDate.input_date* at hybrid_property definition, but How?
Do i have to completely change my approach?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to