Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

92
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda