Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

95
Views
Tortoise complex filters based on user scope

I'm working on an application and I have multiple types of users, teams and files. 2 tables in database are users and files. A user owns a file so the files table has a foreign key field to the user_id. But the files table also has a visibility property an integer that works like permissions on Linux. For example 0x0000 where first 2 bits represents a read and write permission for a team of users and the last 2 for every user of the app, 0x000 means only the owner can read/write to/from the file. 0x1010 mean every user in the same team and every user of the app can read from the file but not write. I need to implement a query to get all the files in user's scope meaning all the files that can be written or read by a certain user. I'm not sure how to write that query, I haven't seen something similar in the Tortoise examples. The query should look something like this

all_files = FilesModel.filter(id=user.id, visibility = ...) //something like visibility & 0x0110 > 0 
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!