Re: How to restrict Model.objects.all() to data pertaining to one organization

2018-04-10 Thread Gabriel - Iulian Dumbrava
I think django-multitenant  
gives you the best answer.

marți, 10 aprilie 2018, 14:04:03 UTC+3, Mauro Crociara a scris:
>
> Hi everyone,
>
> I posted this question 
> 
>  
> on Stackoverflow almost 4 months ago and asked a couple of times on #django 
> IRC channel on Freenode, but none gave me a suggestion about the problem. 
> Up to now I have no solution and no clue how to proceed. Maybe you can show 
> me the right direction. 
>
> Thanks for your time and support!
> Mauro
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/203a3d82-7aee-482d-a753-8520225b8217%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to restrict Model.objects.all() to data pertaining to one organization

2018-04-10 Thread Gabriel - Iulian Dumbrava
Please take a look at this 
 comparison grid. At 
least one of those packages allows automatic filtering of queries if you 
set it up properly. For example, each table must have that 'organisation' 
field to filter on it.

marți, 10 aprilie 2018, 14:04:03 UTC+3, Mauro Crociara a scris:
>
> Hi everyone,
>
> I posted this question 
> 
>  
> on Stackoverflow almost 4 months ago and asked a couple of times on #django 
> IRC channel on Freenode, but none gave me a suggestion about the problem. 
> Up to now I have no solution and no clue how to proceed. Maybe you can show 
> me the right direction. 
>
> Thanks for your time and support!
> Mauro
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7a38587d-8f48-48ef-b61f-44c6157f6548%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to restrict Model.objects.all() to data pertaining to one organization

2018-04-10 Thread Jason
Looking at your SO question, seems to me you're expecting some magic to 
happen without any pertinent information available to execute that filter.

There are a couple things I can think of to add more information to the 
incoming request to help you use the custom model manager.  For example, 
when a user logs in, you specify an organization name that's included in 
all API requests as a query param, and said param is used to execute the db 
query.  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/daf3a2e8-f4b5-4e15-a6fd-9791d71673af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to restrict Model.objects.all() to data pertaining to one organization

2018-04-10 Thread Jani Tiainen
Hi.

Model.objects.filter (organization=organization)

Or did you mean something else?

ti 10. huhtikuuta 2018 klo 14.03 Mauro Crociara 
kirjoitti:

> Hi everyone,
>
> I posted this question
> 
> on Stackoverflow almost 4 months ago and asked a couple of times on #django
> IRC channel on Freenode, but none gave me a suggestion about the problem.
> Up to now I have no solution and no clue how to proceed. Maybe you can show
> me the right direction.
>
> Thanks for your time and support!
> Mauro
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a9647aa9-4743-4bf3-9202-72329e4c38af%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91oer%2BbFUCrGycAKXX6SWmy8cNDfJL%3DnOw4MBS3-aVU-%3Dyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.