Re: ORM performance

2014-09-04 Thread Michael P. Soulier
On 04/09/14 Benjamin Scherrey said: > The short answer to your question is no, the Django ORM is not inherently > slower in that regard and it's very likely something you're doing. The Given that it's basically for obj in foo.objects.all(): obj.prop = new_value obj.save() I fail to see

Re: ORM performance

2014-09-04 Thread Michael P. Soulier
On 03/09/14 Tom Lockhart said: > I haven't had to deal with this myself, but the speed difference smacks of > transactional issues. If you can run your loop by wrapping all of it or > pieces of it (say, 100 or 1000 chunks) in a single transaction you'll > probably see some significant speedup. Ye

Re: ORM performance

2014-09-04 Thread Michael P. Soulier
On 04/09/14 Tom Evans said: > Is the update invariant? By using the ORM like this: As I said, each update is unique and they cannot be batched. > Are both Django and the sqlalchemy doing the same sort of update? Yes. Identical. Mike -- You received this message because you are subscribed to

database error

2013-06-21 Thread Michael P. Soulier
Hi, I have a Django UI with a daemon running in the background, both using the Django models to update the postgres database. When the daemon in the background gets very busy, I'm getting errors in the UI while trying to load the page (simply reading the postgres db). DatabaseError at /clients/mi

Re: TemporaryFileUploadHandler leaving tempfiles behind on disk

2013-03-04 Thread Michael P. Soulier
On 04/03/13 Emiliano Dalla Verde Marcozzi said: > method from my own class that subclass TemporaryFileUploadHandler and do > something like: Yeah, I'm doing that, but it seems odd to me that the handler leaves the file around, when it's supposed to be temporary, no? Mike -- You received this m

Re: unable to save ModelForm with primary key change

2012-11-02 Thread Michael P. Soulier
On 02/11/12 Tom Evans said: > Hmm, looks ok.. do you end up with two entries in the DB, one with the > old primary key, and one with the new primary key? No, and I expected to. > Personally, I don't use natural primary keys with Django, I always let > it create an 'id' primary key, and then add

Re: unable to save ModelForm with primary key change

2012-11-01 Thread Michael P. Soulier
On 01/11/12 Tom Evans said: > Please show the definition of MyForm. I assume you are certain that > the form is valid, ie you have put breakpoints there (or print > statements) and form.is_valid() is definitely returning true. I used MyForm as an example, the actual class is class McdLoad(models

custom upload handlers

2012-09-21 Thread Michael P. Soulier
Looking at the docs... https://docs.djangoproject.com/en/1.4/topics/http/file-uploads/ under "Modifying upload handlers on the fly" it states: "Sometimes particular views require different upload behavior. In these cases, you can override upload handlers on a per-request basis by modifying requ

Re: django FastCGI configuration for Share Host.

2012-07-29 Thread Michael P. Soulier
On 29/07/12 07:48 AM, Александър Ботев wrote: > Hi, > So I followed all the instructions from the django web source about how to > configure it, but all it seems > it gives me a problem - I always get an error 500. > My main concern and I think problem is that when I run my fcgi script it > give

Re: Django Comments Form not Displaying

2012-02-12 Thread Michael P. Soulier
On 12/02/12 coded kid said: > Below is the codes in my comments/form.html > {% load comments i18n %} > {% csrf_token > %} > {% if next %} value="{{ next }}" />{% endif %} > {% for field in form %} > {% if field.is_hidden %} > {{ field }} > {% else %} > {% if field.errors %}

Re: Choicefield in django

2011-11-10 Thread Michael P. Soulier
On 10/11/11 Asif Jamadar said: > Suppose I have choicefield in my django model which consist of several > choices. Now in future if I changed the existing choice (option) with some > other name (choice), then whether the existing records in model with that > choice(option) will also change? Or In

Re: db routing by request

2011-04-22 Thread Michael P. Soulier
;t work for me :)] The issue is a need to run a single UI over multiple virtual instance of an application, each with its own database. So, based on which virtual instance of the app is being managed, I want to route to a particular database corresponding to that application. Mike -- Michael P

db routing by request

2011-04-19 Thread Michael P. Soulier
it be possible in the future to pass the request object to the database router? Thanks, Mike -- Michael P. Soulier "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction." --Alber

Re: redirects and ipv6

2011-01-16 Thread Michael P. Soulier
On 13/12/10 Michael P. Soulier said: > Hi, > > We're enabling ipv6 on a server and finding that redirects in django are > broken. The host portion is being truncated. > > Is this a known problem? So I found the issue. Apache is passing a bad value for the X_HTTP_FORWAR

Re: Linux password authentication for django

2010-12-30 Thread Michael P. Soulier
On 29/12/10 Bill said: > Hi there, > > I want to know is there any authentication module base on Linux passwd/ > shadow file for django? You want pam authentication. Look for django and pam. Mike signature.asc Description: Digital signature

Re: database migration

2010-12-29 Thread Michael P. Soulier
On 29/12/10 Emmanuel Mayssat said: > I was looking at a possibility of using manage.py dumpscript and > manage.py runscript > from django-extensions. But it is not straight forward either. dumpdata/loaddata is quite simple, I recently used it myself. Torsten suggested that there's a problem using

Re: database migration

2010-12-29 Thread Michael P. Soulier
On 29/12/10 Torsten Bronger said: > I don't recommend that. If the database exceeds a certain size (and > "certain" is MBs, not GBs), this simply fails. Is there a bug report for this issue? I find that very disappointing. Mike -- Michael P. Soulier "Any intell

Re: database migration

2010-12-28 Thread Michael P. Soulier
On 28/12/10 Emmanuel Mayssat said: > I have a classic database dump question > > I would like to migrate from sqlite to mysql. > How can I dump and import the data? See the manage.py dumpdata/loaddata commands. Mike signature.asc Description: Digital signature

redirects and ipv6

2010-12-13 Thread Michael P. Soulier
Hi, We're enabling ipv6 on a server and finding that redirects in django are broken. The host portion is being truncated. Is this a known problem? Thanks, Mike -- Michael P. Soulier "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - an

Re: feature request - suppression of newlines from tags

2010-11-06 Thread Michael P. Soulier
; a newline. > > http://code.djangoproject.com/ticket/2594 Yeah, I'd be on board with that. Cheers, Mike -- Michael P. Soulier "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction." --Albert Ei

feature request - suppression of newlines from tags

2010-11-04 Thread Michael P. Soulier
{%- if foo %} newline suppression Likely someone has asked for this already so I'm curious about it. Thanks, Mike -- Michael P. Soulier "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction

Re: include(admin.site.urls)

2010-08-10 Thread Michael P. Soulier
On 10/08/10 Karen Tracey said: > does not work properly. You also have to change the first element of the > tuple: > > (r'^admin/', include(admin.site.urls)), *sigh* Thanks, that was it. Mike -- Michael P. Soulier "Any intelligent fool can make things bigger and

include(admin.site.urls)

2010-08-08 Thread Michael P. Soulier
back to admin.site.root and it works fine. Mike -- Michael P. Soulier "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction." --Albert Einstein signature.asc Description: Digital signature

Re: moving to django 1.2.1

2010-08-08 Thread Michael P. Soulier
On 08/08/10 Michael P. Soulier said: > I've picked-up Django 1.2 locally in a virtualenv for testing, and I'm > finding suddenly that I can't login to the admin site due to a CSRF error. Ah, found it. Somehow some firefox add-on disabled my accepting of cookies. The error

Re: moving to django 1.2.1

2010-08-08 Thread Michael P. Soulier
at I can't login to the admin site due to a CSRF error. I have not enabled CSRF yet, and I have not added custom admin templates. I'm assuming that this is not expected. Mike -- Michael P. Soulier "Any intelligent fool can make things bigger and more complex... It takes a touch

unexpected error with inline model

2010-08-08 Thread Michael P. Soulier
e object 'MeetingTalkInline' has no attribute 'date_hierarchy' Am I doing something wrong here? Thanks, Mike -- Michael P. Soulier "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction." --Albert Einstein signature.asc Description: Digital signature

debugging template inheritance

2010-08-04 Thread Michael P. Soulier
quot;/var/tmp/Django-1.1.1-root/usr/lib/python2.4/site-packages/django/templa te/loader_tags.py", line 66, in get_parent TemplateSyntaxError: Template u'base.html' cannot be extended, because it doesn' t exist So, should this work? Is it a fluke that it works in one project and not the other

Re: moving to django 1.2.1

2010-08-04 Thread Michael P. Soulier
and would in all likelihood be a trigger > for a new point release. That is awesome, thanks. I can safely push the upgrade and I'll report any issues found. Mike -- Michael P. Soulier "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a

Re: moving to django 1.2.1

2010-07-31 Thread Michael P. Soulier
On 30/07/10 tiemonster said: > I cover some of the new changes in Django 1.2 in this article: > http://www.tiemonster.info/a/24005/ > > Most of this information comes straight from the changelist. Others > were things that the core developers must have assumed were common > sense, but that I didn

Re: setting up datebase

2010-07-24 Thread Michael P. Soulier
On 23/07/10 john said: > Hi all, > > I am following the django book. I am to the point of setting up my > datebase. It instructs me to enter the command: > > python manage.py sqlall. I thought that sqlall required an app name. Make sure you've added apps with models, and that you've added th

Re: django + serving static CSS

2010-07-23 Thread Michael P. Soulier
MEDIA_URL and/or MEDIA_ROOT ? Your media config needs to correspond to apache config. For example: SetHandler default Alias /media/admin /usr/lib/python2.6/django/contrib/admin/media Alias /media /path/to/my/project/media Mike -- Michael P. Soulier "Any intelligent fool can make things bi

Re: filter users by full name

2010-07-23 Thread Michael P. Soulier
On 23/07/10 Santiago Perez said: > If you're using MySQL then this should work: > > models.User.objects.extra(where=["concat(first_name, ' ', last_name)=%s"], > params=["John Test"]) > > Not sure how portable the concat function is or what alternatives are there > in other backends but shouldn't

Re: filter users by full name

2010-07-22 Thread Michael P. Soulier
> > Is list comprehensions the only way to go? Assuming that full_name is a property in your model, then q = User.objects.filter(full_name="John Test") should work. Mike -- Michael P. Soulier "Any intelligent fool can make things bigger and more complex... It takes a touch

Re: Accessing new_object when processing formsets in Admin

2009-02-15 Thread Michael P. Soulier
dation of forms based on whether a given form is valid, sometimes passing a valid form to the next in the sequence since at times information in them cannot be duplicated. Django doesn't seem to be designed for much of this conditional validation, but it certainly can be done. Mike -- Michae

customizing django-admin.py

2008-06-27 Thread Michael P. Soulier
do this beyond wrapping django-admin.py in a shell script and post-processing the created files? Thanks, Mike -- Michael P. Soulier <[EMAIL PROTECTED]> "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in t

Re: sending large downloads

2008-06-23 Thread Michael P. Soulier
s always desirable. Sometimes you just need more flexibility. I suppose that piece of code could be a simple Python CGI, but having to break out of the framework indicates a deficiency there. I wonder if I could pull this off with a custom HttpResponse subclass. Mike -- Michael P. Soulier

Re: Add db tables on-the-fly

2008-06-23 Thread Michael P. Soulier
MickaelC wrote: > It is not really a problem > It's for a multi user app. For each new users, i create a serie table > or all data in the same table? > If it's easy to create table on-the-fly when a new user registers, i > prefere. > > but I do not see how If you must, that is what raw SQL is for

Re: Bug in sqlite backend? Custom query gives OperationalError

2008-06-09 Thread Michael P. Soulier
query with mysql on different server(same django version) and it > worked great. Since you're talking about the sqlite backend, did you try this on the sqlite command-line? Mike -- Michael P. Soulier <[EMAIL PROTECTED]> "Any intelligent fool can make things bigger and more comple