Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

93
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda