bulk add m2m relationship for multiple instances

2015-08-11 Thread yakkadesign
My app is getting killed by adding m2m relationships. I can bulk create the objects but for the m2m I have to iterate over them which is super slow. I'm looking for a way to bulk add the m2m relationships. Here is a example: class Sensor(models.Model): Name = models.CharField(

Re: Serving uploaded files from multiple storages

2015-08-11 Thread Javier Guerra Giraldez
On Tue, Aug 11, 2015 at 6:17 PM, 'Hugo Osvaldo Barrera' via Django users wrote: > I've an app where files are uploaded to differente storages: i would create a new storage object with a configuration that associates some prefix with other 'backend' storage

Re: Console Routes With Django ??

2015-08-11 Thread Tom Lockhart
> On Aug 11, 2015, at 12:29, Prabath Peiris wrote: > > Hi > > I am new to (kind of) Django framework and just finish the > Django-REST-framework tutorials and it looks really cool. I am a big fan of > ZendFramework2.0 (with Apigility) and trying to make parallels

Serving uploaded files from multiple storages

2015-08-11 Thread 'Hugo Osvaldo Barrera' via Django users
I've an app where files are uploaded to differente storages: Certain files uploaded via de the admin are uploaded to S3 (and served via a CDN) (using a storage from django-storages). Other files (user-uploaded files), are saved into into our local storage (using the default FileField storage).

Re: Console Routes With Django ??

2015-08-11 Thread Gergely Polonkai
Hello, as far as I know, Django doesn't have thin functionality built in. I would be interested in such an app, though… Best, Gergely On 11 Aug 2015 21:30, "Prabath Peiris" wrote: > Hi > > I am new to (kind of) Django framework and just finish the >

Problems installing a Django package

2015-08-11 Thread durirompepc
I did the tutorial for reusable apps for Django. All went well... but then I get problems when installing the app. Processing ./django-muro_humoristas/dist/django-muro_humoristas-1.tar.gz Requirement already satisfied (use --upgrade to upgrade): django-muro-humoristas==1 from

Console Routes With Django ??

2015-08-11 Thread Prabath Peiris
Hi I am new to (kind of) Django framework and just finish the Django-REST-framework tutorials and it looks really cool. I am a big fan of ZendFramework2.0 (with Apigility) and trying to make parallels between these two frameworks. My primary question is about console routes. In ZF2 you can

Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Uri Even-Chen
Thanks Fabio, we'll check RapydScript and we might use it for Speedy Mail Software as well! I will check with the other developers (which are on the speedy-mail-software list). In the past I had Speedy Mail online from 2000 to 2005 and it was based on a Perl script (Perl was popular in 2000). But

Testing Signals

2015-08-11 Thread Grant Means
I have an app that fires a custom signal when a specific method is called. I wrote a test that connects to the signal in setUp() and uses a local listener function to set a class attribute to True if the handler is called. You can see the relevant code here: https://dpaste.de/mAGw This works

Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Uri Even-Chen
Thanks Fabio, it's very interesting. Are you related to Pyjeon Software? Do we have to pay to use RapydScript? Is it ready for production? *Uri Even-Chen* [image: photo] Phone: +972-54-3995700 Email: u...@speedy.net Website: http://www.speedysoftware.com/uri/en/

InterfaceError: connection already closed from psycopg2 when running Django Tests

2015-08-11 Thread TheBeardedTemplar
I'm trying to implement testing on a fairly large Django site, and I'm encountering a psycopg2 error when running all the tests at once using `python manage.py test`. If I specify each app name individually, it works fine (some tests fail, but all for legitimate reasons), however when I run

Re: How to use Django 1.8.2 with Python 2.7?

2015-08-11 Thread Carl Meyer
Hi, On 08/11/2015 11:56 AM, jsa...@nvidia.com wrote: > I'm studying the Django Project tutorial > using Python > 2.7 (because that's my department's current standard) and Django 1.8.2 > (because that's the current stable version). > > The

Re: How to use Django 1.8.2 with Python 2.7?

2015-08-11 Thread Andrew Farrell
Hi jsachs, Could you reply to the list with a couple copy-pasted outputs to help diagnose the problem? 1) From the window shell, could you run `python manage.py shell` and paste the output? Could you also please run `dir` and paste that output? 2) Could you also trigger that same error the full

Re: Different auth user models withoout doing multi-table inheritance

2015-08-11 Thread James Schneider
> > > Hi James, thanks for the elaborate answer. Not that explicit OneToOne > relationships are bad but I was just trying to avoid the overhead due to > the JOINs that comes with it. > >> >> Understood. Unless you specifically request the data either by accessing the .merchant_data FK attribute or

How to use Django 1.8.2 with Python 2.7?

2015-08-11 Thread jsachs
I'm studying the Django Project tutorial using Python 2.7 (because that's my department's current standard) and Django 1.8.2 (because that's the current stable version). The tutorial says, "If you are still using Python 2.7, you will

New tool to build django deb package

2015-08-11 Thread aRkadeFR
Hey guys, I wanted to share with you a little project I did for myself first: https://github.com/aRkadeFR/dh-python-django It's a build system paired with debhelper. It helps you build .deb django package with systemd/nginx/uWSGI/virtualenv. It's not finished yet, and obviously I take into

Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Uri Even-Chen
Thanks for the feedback. Actually I asked this question also in the django-users mailing list and Russell Keith-Magee told me about Brython, Skulpt and PyPy.js (I hope it's OK that I reply to these 3 mailing lists) but I also asked if I can use JavaScript scripts such as jQuery, jQuery UI and

Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Uri Even-Chen
Thank you Russ. If it's not possible to do it easily in production then I guess we are stuck with JavaScript, although I prefer Python. But without jQuery, jQuery UI and other jQuery plugins I find it very difficult to write client side scripts in Python. So I think we will write client side

Re: display readonly or not

2015-08-11 Thread Mike Dewhirst
On 11/08/2015 7:17 PM, Daniel Roseman wrote: On Tuesday, 11 August 2015 06:24:32 UTC+1, Mike Dewhirst wrote: Â There is a get_read_only() method in the admin.ModelAdmin class. It normally returns self.readonly_fields but you can give it a callable.

Re: display readonly or not

2015-08-11 Thread Tony Peña
because i don't know how... that's why i ask :) 2015-08-11 11:17 GMT+02:00 Daniel Roseman : > On Tuesday, 11 August 2015 06:24:32 UTC+1, Mike Dewhirst wrote: > > >> There is a get_read_only() method in the admin.ModelAdmin class. It >> normally returns self.readonly_fields

Re: display readonly or not

2015-08-11 Thread Daniel Roseman
On Tuesday, 11 August 2015 06:24:32 UTC+1, Mike Dewhirst wrote: > There is a get_read_only() method in the admin.ModelAdmin class. It > normally returns self.readonly_fields but you can give it a callable. > > >

ATOMIC_REQUESTS Middleware inside Transaction

2015-08-11 Thread guettli
I am not happy that settings.ATOMIC_REQUESTS=True isolates only the view, but not the middlewares in one transaction. For applications like reversion (app which records the changes of a model) it is very important, that the middleware runs inside the same transaction. If storing the changes

Re: display readonly or not

2015-08-11 Thread Tony Peña
hmmm.. not work the field max_account must be modify for superuser not for the staff. class VeximDomainAdmin(admin.ModelAdmin): list_display = ('domain', 'enabled', 'avscan', 'spamassassin', 'max_accounts') list_filter = ('enabled',) exclude = ('uid', 'gid', 'pipe', 'maildir',

Re: How access verbose_name of a field in template?

2015-08-11 Thread James Schneider
You could write up a simple template tag (or even a template filter) to do this. https://docs.djangoproject.com/en/1.8/howto/custom-template-tags/#simple-tags Something along these lines would probably work: # templatetags.py register = template.Library() @register.simple_tag def