NationalAssociationOfRealtors / libRETS

libRETS is RETS client library written in C++ that allows rapid development of RETS client applications. By saving the developer from dealing with the RETS protocol details, the application writer can concentrate on their application, saving them time and money in the process
Other
107 stars 59 forks source link

query.GetColumns() returns empty tuple #62

Closed giovannirescia closed 6 years ago

giovannirescia commented 6 years ago

Hi all, am using libRETS for the first time, and used the Developer's Guide as a tutorial, the problem is that I can't get the columns from the queries, for example:

req = session.CreateSearchRequest("Property", "CMF", "(YearBuilt=1+) , (ListingStatus=|1,2)")
res = session.Search(req)

res.GetCount() yields 438 hits, but res.GetColumns() returns an empty tuple, what am I missing?

I am using the Python binding for this.

Thanks, Giovanni

nyousefzai commented 6 years ago

I think the issue is with your query. not that familiar with python but you can try

req = session.CreateSearchRequest("Property", "CMF", "(YearBuilt=2018-)")

you can create different search query based on your feed class and tables.

giovannirescia commented 6 years ago

@nyousefzai That didn't do trick either, I also tried different queries and classes.

nyousefzai commented 6 years ago

are you able to get metadata?

giovannirescia commented 6 years ago

Yes, I can get the metadata. Finally I solved this problem with the following line req.SetFormatType(librets.SearchRequest.COMPACT_DECODED).

Valachio commented 6 years ago

@giovannirescia Thanks for posting that solution. Saved me hours of figuring out a solution.

Quick question for you - are the 'Date' fields looking weird for you when setting the request to COMPACT_DECODED? My date fields are coming out in this format: XX:XX.0 and it doesn't seem to include the date.

giovannirescia commented 6 years ago

@Valachio I switched to https://github.com/opendoor-labs/rets which is easier to use, hope it helps you!

Valachio commented 6 years ago

@giovannirescia Thanks for that link. For whatever reason I cannot seem to login with opendoor's rets client. Going have to figure out this date issue with librets...