0

I'm running into an issue with the peewee regexp function. Queries like this work the first time I run it:

query = Table.select().where(Table.column.regexp('string'))

However, if I try to run it with a different string, I get this error: 'unicode' object has no attribute 'regexp':

query = Table.select().where(Table.column.regexp('string2'))

I usually run it twice because I need to see how specific to make the regexp string.

I've tried disconnecting/reconnecting to the db, but that doesn't help. The only thing that works is if I close ipython and restart it. Is this a memory/buffer issue? Is there a good way to get this to work? Thanks in advance.

anonygrits
  • 1,459
  • 2
  • 14
  • 19
  • https://github.com/coleifer/peewee/issues/415 – coleifer Aug 14 '14 at 13:48
  • At some point in your code are you assigning a value to `Table.column`? Possibly `Table.column = `? – coleifer Aug 14 '14 at 14:01
  • Update: moved to github & closed there w/no resolution. Using MySQL to query & peewee to pull data directly into python. https://github.com/coleifer/peewee/issues/417#issuecomment-52256402 – anonygrits Aug 16 '14 at 14:10
  • Another update: if I do a few things in between and then try another regexp query, it works... I'm wondering if the db is locked somehow from the prior query & it just takes time to release it? – anonygrits Aug 19 '14 at 03:33

0 Answers0