Search user from Database

2015-03-26 Thread nobody
Hi, Sorry for asking a new B question. I have following code in a module.py: class Group(models.Model): .. users = models.ManyToManyField(User, blank=True, null=True) . I can add user or delete user by calling Group.users.add(user) or Group.users.remove(user), but how can I check if

Re: Why is list(Model.objects.all()) 10x slower against an Oracle database as compared to Postgres?

2015-03-26 Thread tkdchen
On Wednesday, March 25, 2015 at 4:49:48 AM UTC+8, Daniel Porter wrote: > > I have an application that we run locally against a postgres database but > our dev/test/prod servers all run Oracle. > > The command list(Person.objects.all()) runs remarkably faster against my > local Postgresql

Django 1.8 ArrayField append & extend

2015-03-26 Thread Samuel Colvin
Please forgive me for cross posting, I asked this question on stack overflow 2 weeks and have "earnt the tumbleweed award for no one commenting or replying to it" (no really, it's a real thing). Django 1.8 will come with new advanced field types including ArrayField

When I mark to delete the formset, django requires complete all fields, he does not ignore the marked form to delete.

2015-03-26 Thread Neto
When I mark to delete the formset, django requires complete all fields, he does not ignore the marked form to delete. How do I solve this? I wanna that django delete the form marked or ignore him. from django.forms.formsets import formset_factory>>> from myapp.forms import ArticleForm>>>

Re: QueryDict and its .dict() method - why does it do that?

2015-03-26 Thread Masklinn
On 2015-03-26, at 18:48 , Gabriel Pugliese wrote: > This gist is self informative - some information from list is lost: > https://gist.github.com/gabrielhpugliese/640b69eefc5b7490a07c > > Some of my buddies have pasted Rails(Rack) and PHP conversion right below. Is

Internationalization to 3rd party Django apps

2015-03-26 Thread Luis Masuelli
I use django-rest-framework==3.0 in an application as an example case (*) of what I am talking about. Most of the messages in DRF are not internationalized, and had to use the following mechanism to create the internationalization for DRF messages: - Properly set LANGUAGES and locale

Re: QueryDict and its .dict() method - why does it do that?

2015-03-26 Thread Daniel Roseman
On Thursday, 26 March 2015 17:52:48 UTC, Gabriel Pugliese wrote: > > This gist is self informative - some information from list is lost: > https://gist.github.com/gabrielhpugliese/640b69eefc5b7490a07c > > Some of my buddies have pasted Rails(Rack) and PHP conversion right below. > Is that

QueryDict and its .dict() method - why does it do that?

2015-03-26 Thread Gabriel Pugliese
This gist is self informative - some information from list is lost: https://gist.github.com/gabrielhpugliese/640b69eefc5b7490a07c Some of my buddies have pasted Rails(Rack) and PHP conversion right below. Is that something I am missing? Does it have to do with laziness? -- You received this

Re: Django project for multiple clients

2015-03-26 Thread Steven Nash
This looks like it could be a good solution. Steve On Thursday, 26 March 2015 17:02:32 UTC, Simon Charette wrote: > > This concept is called multi-tenancy. > > I suggest you have a look at the django-tenant-schema > application > which

Re: Django project for multiple clients

2015-03-26 Thread Simon Charette
This concept is called multi-tenancy. I suggest you have a look at the django-tenant-schema application which isolate each tenant in it's own PostgreSQL schema. You could also build you own solution using a middleware and a database

Django project for multiple clients

2015-03-26 Thread Steven Nash
We are design a DJango based application to be used my multiple clients. Each client will have there own database but share the same code base. In the past, when I've done something like this, I have configure a separate virtual host for each client. This time we are thinking about using URL

Re: Global access to request.user

2015-03-26 Thread Esau Rodriguez
I don't see how middleware could be used to avoid passing the user or request parameter to the inner methods. As this is part of the view, I'd probably write a custom filter or tag, I dunno. Regards, Esau. On Thu, Mar 26, 2015 at 2:52 PM, Anderson Resende wrote: >

Re: how to access manager from a model instance?

2015-03-26 Thread felix
El 26/03/15 11:19, Erik Cederstrand escribió: Den 25/03/2015 kl. 20.20 skrev felix : Yes I know I can't acces the Manager from a model instance, but I need to check the value of a field saved in the database before updating it. Can I do it from the Model clean() method?

Re: Accessing django app from another app with ajax

2015-03-26 Thread aRkadeFR
No problem we agree that having a stacktrace would be a better way to debug it. Even on a 400 :) On 03/26/2015 03:48 PM, Filipe Ximenes wrote: My mistake. On Thu, Mar 26, 2015 at 11:42 AM, aRkadeFR > wrote: But from the first email, the

Re: how to access manager from a model instance?

2015-03-26 Thread Erik Cederstrand
> Den 25/03/2015 kl. 20.20 skrev felix : > > Yes I know I can't acces the Manager from a model instance, but I need to > check the value of a field saved in the database before updating it. Can I do > it from the Model clean() method? Depending on your requirements,

Re: Global access to request.user

2015-03-26 Thread Anderson Resende
You can use middlewares!!! It is a way... -- 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,

Re: Accessing django app from another app with ajax

2015-03-26 Thread Filipe Ximenes
My mistake. On Thu, Mar 26, 2015 at 11:42 AM, aRkadeFR wrote: > But from the first email, the debug settings is already at True > and he is not getting a stacktrace... > > > On 03/26/2015 03:40 PM, Filipe Ximenes wrote: > > In case there's no one using your project and

Re: how to access manager from a model instance?

2015-03-26 Thread Anderson Resende
Can you give a example? be more especific, post some code. -- 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

Re: Accessing django app from another app with ajax

2015-03-26 Thread aRkadeFR
But from the first email, the debug settings is already at True and he is not getting a stacktrace... On 03/26/2015 03:40 PM, Filipe Ximenes wrote: In case there's no one using your project and there's no sensitive data in it, you can briefly set DEBUB to True in the server to see stack

Re: Accessing django app from another app with ajax

2015-03-26 Thread Filipe Ximenes
In case there's no one using your project and there's no sensitive data in it, you can briefly set DEBUB to True in the server to see stack traces. On Thu, Mar 26, 2015 at 11:26 AM, Larry Martell wrote: > On Thu, Mar 26, 2015 at 10:20 AM, aRkadeFR

Re: Accessing django app from another app with ajax

2015-03-26 Thread Larry Martell
On Thu, Mar 26, 2015 at 10:20 AM, aRkadeFR wrote: > You should setup your project so you're able to retrieve the > stacktrace on a 500 server error. When there is a stack trace I get it (e.g. when I was getting the 403 error). There was no stack trace when I was getting the

Re: Accessing django app from another app with ajax

2015-03-26 Thread aRkadeFR
You should setup your project so you're able to retrieve the stacktrace on a 500 server error. On 03/26/2015 12:25 PM, Larry Martell wrote: On Thu, Mar 26, 2015 at 7:22 AM, aRkadeFR wrote: Do you have the stacktrace? Without it it's gonna be hard to help you. My only

How to mock a model backend

2015-03-26 Thread Sven Mäurer
In my model backend I usually call an external service which returns me an user that is saved and returned. When I don't have credentials I want to mock the backend for some test cases. In the setup of each test case I am calling the login method where CRED contains the real credentials or mock

Re: Accessing django app from another app with ajax

2015-03-26 Thread Larry Martell
On Thu, Mar 26, 2015 at 7:22 AM, aRkadeFR wrote: > Do you have the stacktrace? Without it it's gonna be hard > to help you. > > My only guess is CORS (Cross-Origin Resource Sharing)? But > you should have the same error on local dev if you have similar > setup from your

Re: Accessing django app from another app with ajax

2015-03-26 Thread aRkadeFR
Do you have the stacktrace? Without it it's gonna be hard to help you. My only guess is CORS (Cross-Origin Resource Sharing)? But you should have the same error on local dev if you have similar setup from your production. On 03/26/2015 02:04 AM, Larry Martell wrote: I have a webservice written

Re: Django Integrate custom apps with each other

2015-03-26 Thread aRkadeFR
Hello, Everything is an application in Django, and you can see them in settings.INSTALLED_APPS. Then you can include your app models/forms/etc. from anywhere else in the project containing the previous app. To check if the app is registrered or not, you can use the Django Application (new in

Django Integrate custom apps with each other

2015-03-26 Thread Eduardo Pascoal
Hi everyone, I am a Django newbie and I'm facing the problem related with binding applications. My intention is to make a new functionality to manage comments (i don't want to use disqus) and for that reason i want to create an application and integrate with another one that i've created in

Global access to request.user

2015-03-26 Thread guettli
I have a large legacy application which passes around the request to nearly every method. Reading this source is no fun. In about 95% of all cases "request" is not used, but "request.user" is needed for permission checking. Example: there is a drop down box with the list of possible actions

Re: Image resizing

2015-03-26 Thread Akash Patni
*Hi,* *Resizing is now working properly but the issue is that it is giving key error.* *it is taking all files for eg(images.bmp,xx.jpeg) but is giving error when i am tryint to upload the file (luzern-bridge-8q4_small.jpg) In short it is giving error for jpg format. Please suggest* def