Git Product home page Git Product logo

Comments (4)

shince-tonetag avatar shince-tonetag commented on May 24, 2024

@coleifer

from walrus.

coleifer avatar coleifer commented on May 24, 2024

If you can produce a test script that demonstrates the problem, I will re-evaluate this issue.

from walrus.

shince-tonetag avatar shince-tonetag commented on May 24, 2024

`db = Database(host='localhost', port=6379, db=0)

class Store(Model):
database = db
id = AutoIncrementField(primary_key=True,index=True)
tid = IntegerField(primary_key=True,index=True)
store_name = TextField(fts=True,index=True)
store_location = TextField(fts=True,index=True)
store_pincode = TextField(fts=True,index=True)
store_size = TextField(fts=True,index=True)

def get_store(session, store_id):
existing_user = None
store_list = Store.query(Store.tid == int(store_id)) //1
store_list = Store.get(Store.tid == int(store_id)) //2
return store_list

I am not able to run this get_store method, it returns null when filtering through tid column,

@coleifer
`

from walrus.

coleifer avatar coleifer commented on May 24, 2024
db = Database()
db.flushall()

class Store(Model):
    __database__ = db
    id = AutoIncrementField(primary_key=True, index=True)
    tid = IntegerField(index=True)
    name = TextField(fts=True, index=True)

for i in range(1, 10):
    s = Store.create(tid=i, name='s%s' % i)


for store in Store.query(Store.tid == 2):
    print(store.tid, store.name)

store = Store.get(Store.tid == 2)
print(store.tid, store.name)

This prints the following on my machine:

2 s2
2 s2

from walrus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.