Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query filter doesn't work, like at all #148

Open
Goury opened this issue Jan 11, 2021 · 2 comments
Open

query filter doesn't work, like at all #148

Goury opened this issue Jan 11, 2021 · 2 comments
Assignees
Labels
bug fixed more added when Josiah is waiting for more from op

Comments

@Goury
Copy link

Goury commented Jan 11, 2021

class Log(rom.Model):
	user_id       = rom.Integer(default=-1, index=True)
	dnt           = rom.Boolean(default=False)
	session_id    = rom.String(default='', index=True, keygen=rom.CASE_INSENSITIVE)
	ip_address    = rom.String(default='', index=True, keygen=rom.CASE_INSENSITIVE)
	host          = rom.Text(default='')
	path          = rom.Text(default='', index=True, keygen=rom.SIMPLE)
	query_string  = rom.Text(default='', index=True, keygen=rom.CASE_INSENSITIVE)
	method        = rom.String(default='', index=True, keygen=rom.SIMPLE)
	payload       = rom.Text(default='', index=True, keygen=rom.CASE_INSENSITIVE)
	user_agent    = rom.Text(default='', index=True, keygen=rom.CASE_INSENSITIVE)
	status_code   = rom.Integer(default=-1, index=True)
	referrer      = rom.Text(default='', index=True, keygen=rom.SIMPLE)
	timestamp     = rom.DateTime(default=datetime.now, index=True)
In:  len( Log.query.filter(path='/').all() )
Out: 0
in:  len( [log for Log.query.all() if log.path='/'] )
Out: 26847

Tried rom 0.40.1, 0.42.0, 0.42.6, 1.0.0, 1.0.1
Results are the same.

Why?

@josiahcarlson
Copy link
Owner

josiahcarlson commented Jan 11, 2021

Changelog:

#----------------------------------- 1.0.0 -----------------------------------
[WARNING] data indexed in this version is NO LONGER COMPATIBLE with data indexed
    in versions < 1.0.0, THIS VERSION WILL AUTOMATICALLY CONVERT YOUR INDEXES on
    save, and older clients saving may not update indexes properly.
  1. What's in your Redis? Do you see index keys? Model keys? If you have model keys at least, you can always rebuild via:
# import all your models
rom.util.refresh_all_indexes()
  1. I need to fix rom.util.refresh_all_indexes()

@josiahcarlson josiahcarlson self-assigned this Jan 12, 2021
@josiahcarlson
Copy link
Owner

Check rom 1.0.2

@josiahcarlson josiahcarlson added bug fixed more added when Josiah is waiting for more from op labels Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fixed more added when Josiah is waiting for more from op
Projects
None yet
Development

No branches or pull requests

2 participants