Re: ANN: dse 0.3.0 DSE - Delayed SQL Executor

2011-01-07 Thread bruno desthuilliers
On 6 jan, 15:49, Thomas Weholt wrote: > Just released a new version of DSE for django and would like to get > comments, flames, whatever. > > http://pypi.python.org/pypi/dse/0.3.0 > Ok, just browsed the project page, but there's already something that bugs me : mixedCaps method names instead of

Re: ANN: dse 0.3.0 DSE - Delayed SQL Executor

2011-01-07 Thread Cal Leeming [Simplicity Media Ltd]
Do you have any performance comparisons? Would be interested to see them. Cheers Cal On Fri, Jan 7, 2011 at 8:40 AM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > > > On 6 jan, 15:49, Thomas Weholt wrote: > > Just released a new version of DSE for django and would like to get >

Re: ANN: dse 0.3.0 DSE - Delayed SQL Executor

2011-01-07 Thread Thomas Weholt
On Fri, Jan 7, 2011 at 9:40 AM, bruno desthuilliers wrote: > > > On 6 jan, 15:49, Thomas Weholt wrote: >> Just released a new version of DSE for django and would like to get >> comments, flames, whatever. >> >> http://pypi.python.org/pypi/dse/0.3.0 >> > > Ok, just browsed the project page, but th

Re: ANN: dse 0.3.0 DSE - Delayed SQL Executor

2011-01-07 Thread Thomas Weholt
On Fri, Jan 7, 2011 at 9:45 AM, Cal Leeming [Simplicity Media Ltd] wrote: > Do you have any performance comparisons? Would be interested to see them. > Cheers > Cal These tests were all done using an in-memory SQLite database: Lots of inserts using dse: dex = dse.ModelDelayedExecutor(fo

Re: ANN: dse 0.3.0 DSE - Delayed SQL Executor

2011-01-07 Thread bruno desthuilliers
On 7 jan, 10:00, Thomas Weholt wrote: > On Fri, Jan 7, 2011 at 9:40 AM, bruno desthuilliers > > wrote: > > > On 6 jan, 15:49, Thomas Weholt wrote: > >> Just released a new version of DSE for django and would like to get > >> comments, flames, whatever. > > >>http://pypi.python.org/pypi/dse/0.3.0

Django admin - action on delete

2011-01-07 Thread robos85
What action is initialized when delete link is clicked? I user save_model() to override default save action, but can't find action to override delete procedures. I need it:/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Dynamically Generating a Tuple for use within Settings.py

2011-01-07 Thread bdunlay
Hi everyone -- I'd like to dynamically generate a tuple of users in a tuple from my UserProfile model and assign it to a variable within my settings file. Do you have any suggestions for accomplishing this? -- You received this message because you are subscribed to the Google Groups "Django user

RE: list of lists in template

2011-01-07 Thread Chris Matthews
{% for Ltarp in smth.3 %} SHOULD BE {% for Ltarp in smth.2 %} 'cos Lans only has 3 elements and Ltarp is Lans[2]. Chris -Original Message- From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com] On Behalf Of gintare Sent: 07 January 2011 08:52 To: Django users Sub

Re: Changing a constraint with live data

2011-01-07 Thread Sithembewena Lloyd Dube
Thanks Shawn. Great to note that someone has thought of this before. On Wed, Jan 5, 2011 at 5:24 PM, Shawn Milochik wrote: > > On Jan 5, 2011, at 4:44 AM, Sithembewena Lloyd Dube wrote: > > Thomas and Shawn, thanks for responding. > > South looks pretty useful - I hope that it could be included

Accessing the corresponding object for a form instance

2011-01-07 Thread Sithembewena Lloyd Dube
Hi all, I have a form which inherits ModelForm and is attached to a model via a Meta class. I wish to find out if/ how I could access the return object (model) for a form instance after calling save() on the form. I need to access the id of the newly saved return object e.g: *in models.py:* clas

Re: Accessing the corresponding object for a form instance

2011-01-07 Thread Dan Fairs
> > the, in views.py: > form = PersonForm(request.POST) > form.save() # how to return person's id here? instance = form.save() print instance.id Cheers, Dan -- Dan Fairs | dan.fa...@gmail.com | www.fezconsulting.com -- You received this message because you are subscribed to the Google Groups

Error on Production Server (TemplateSyntaxError: Caught ImportError while rendering: No module named testapp)

2011-01-07 Thread Thomas M
Hi, I've just set up a server with apache2 and mod_wsgi. Now I want to run django on this Server but it crashes with this error message: "TemplateSyntaxError: Caught ImportError while rendering: No module named testapp" I've configured the Server this way: My django code is in: /www/django/bellc

Re: Massive insertion of records

2011-01-07 Thread Derek
Thomas That looks potentially useful - can you please give an example (on the webpage) of how to do a multi-row insertion? I typically need to add thousands of rows from existing spreadsheets - am using xlrd to read the data, but if DSE could speed up the write-to-database operation, that would b

Re: Error on Production Server (TemplateSyntaxError: Caught ImportError while rendering: No module named testapp)

2011-01-07 Thread Tonton
hello i am not sure if i can help you but from my config use os.environ["DJANGO_SETTINGS_MODULE"] = "bellcher.settings" (like in installed apps) or mv django.wsgi in /Bellcher WSGIScriptAlias / /www/django/bellcher/django.wsgi regards On Fri, Jan 7, 2011 at 2:26 PM, Thomas M wrote: > Hi, > >

RE: ReportLab and Django - templates? ; FK object has no attribute split

2011-01-07 Thread Sells, Fred
Depending on what you need to do You could shell down and run FOP from Apache foundation which is xml, xslt to pdf Or if you are filling in a form, you can use Adobe LiveCycle to define a form and use code like below to fill in the form def getPDFContent(id): values = getAllValues(id)

Re: Massive insertion of records

2011-01-07 Thread Thomas Weholt
On Fri, Jan 7, 2011 at 2:31 PM, Derek wrote: > Thomas > That looks potentially useful - can you please give an example (on the > webpage) of how to do a multi-row insertion?  I typically need to add > thousands of rows from existing spreadsheets - am using xlrd to read the > data, but if DSE could

Re: Can't use dumpdata and loaddata to migrate non-ASCII data between databases

2011-01-07 Thread derek
Maybe Google for this? e.g. http://www.codesmell.org/blog/2009/03/migrate-data-from-postgres-to-mysql/ On Jan 4, 1:49 am, Eric Chamberlain wrote: > Or is there a better way to migrate a database from postgres to MySQL? > > On Jan 3, 2011, at 6:35 PM, Eric Chamberlain wrote: > > > > > > > > > H

Re: Django admin - action on delete

2011-01-07 Thread Scott Hebert (slaptijack)
On Jan 7, 5:18 am, robos85 wrote: > What action is initialized when delete link is clicked? > I user save_model() to override default save action, but can't find action > to override delete procedures. I need it:/ Every model has a delete() method. You should be able to override it. http://docs.

Re: Error on Production Server (TemplateSyntaxError: Caught ImportError while rendering: No module named testapp)

2011-01-07 Thread Thomas M
Ok, I've called the sittings file with "bellcher.settings" and moved it into the projects root folder. Now there are no Error Mesages anymore but django still wont work. If I access the server's IP I am getting a "500 - Internal Server Error" I've posted my Server Configuration above. Do you have

Re: Accessing the corresponding object for a form instance

2011-01-07 Thread Sithembewena Lloyd Dube
Dan and Chris, thanks! That was exactly what I needed. @Chris, sorry about the double-post. On Fri, Jan 7, 2011 at 2:55 PM, Dan Fairs wrote: > > > > the, in views.py: > > form = PersonForm(request.POST) > > form.save() # how to return person's id here? > > instance = form.save() > print instanc

Re: I get an error when I used urllib2.urlopen() to open a remote file in a ftp server

2011-01-07 Thread Scott Hebert (slaptijack)
>         file = 'ftp:/16.168.250.14:2189/RTVE/VIDEOS/Thisisit.wmv' Looks like you are missing a second slash before the IP address there. file = 'ftp://16.168.250.14:2189/RTVE/VIDEOS/Thisisit.wmv' -- Scott Hebert http://slaptijack.com/ -- You received this message because you are subscribed t

Re: I get an error when I used urllib2.urlopen() to open a remote file in a ftp server

2011-01-07 Thread DaithiF
Hi, you only have 1 forward slash after the ftp: protocol string, you need two: 'ftp:*/*/16.168.250.14:2189/RTVE/VIDEOS/Thisisit.wmv' -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroup

Re: Custom queryset on a ModelForm field

2011-01-07 Thread derek
Re: "why isn't there a proper API documentation on django like doxygen? I find the django documentation full of content but awful structure! " Have a look at: http://docs.djangoproject.com/en/dev/internals/documentation/ I am curious as to what specific problems you have? I have read the docs f

Re: A few beginner questions

2011-01-07 Thread derek
Re: "inversion of control" in Python - look at: http://plope.com/control_inversion http://code.activestate.com/recipes/413268-dependency-injection-the-python-way/ http://blog.code.zaubersoftware.com/2009/04/controlfreak-python-inversion-of.html On Jan 5, 12:06 am, Ondřej Mirtes wrote: > Hello,

Re: Error on Production Server (TemplateSyntaxError: Caught ImportError while rendering: No module named testapp)

2011-01-07 Thread Thomas M
I have to correct myself: It still doesnt find "testapp", so nothing has changed :( On 7 Jan., 14:53, Thomas M wrote: > Ok, I've called the sittings file with "bellcher.settings" and moved > it into the projects root folder. > Now there are no Error Mesages anymore but django still wont work. >

Re: A few beginner questions

2011-01-07 Thread derek
Re: " I would like to read about some best practices about midsize and large Django projects." I would recommend first implementing a small-ish but meaningful (i.e. something that addresses a Real World problem, and that you will actually use) project; that way you will see the overall structure a

Can I add custom field to ModelForm?

2011-01-07 Thread robos85
Is it possible to add field (I want it to be visible in generated form and after post) to form which is not included in Model? I need it to make a check after form.is_valid(), but this field won't go to DB. If yes - how can I do that? -- You received this message because you are subscribed to

Re: Can I add custom field to ModelForm?

2011-01-07 Thread satyandra babu
Hi, i think form choice will work in this case. http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ class AuthorForm(forms.Form): name = forms.CharField(max_length=100) title = forms.CharField(max_length=3, widget=forms.Select(choices=TITLE_CHOICES)) birth_da

Re: Django admin - action on delete

2011-01-07 Thread Mark (Nosrednakram)
There is a warning in on overriding delete, maybe not a concern for you but worth knowing about.: http://docs.djangoproject.com/en/dev/topics/db/models/ Note that the delete() method for an object is not necessarily called when deleting objects in bulk using a QuerySet. To ensure customized delet

render_to_response format using forms

2011-01-07 Thread hank23
In the topics forms documentation there's an example of using a form in a view which shows a return statement using a render_to_respone shortcut like this: return render_to_response('contact.html', { 'form': form, }) but in the shortcuts documentation it shows an example of using render_to_r

i18n django models

2011-01-07 Thread Mo Mughrabi
Hello, in my design there are some models where I need to store certain fields in different languages. I was wondering if anyone has done it before? I saw some django modules that help do model translations but some of them did not work properly. Any best practices out there? below is my code *m

Re: Django admin - action on delete

2011-01-07 Thread galago
I made what I wanted in def log_deletion(self, request, object, object_repr): It's not elegant, but in Django 1.3 there is a delete_model() function:) But now I'm using 1.2.4 :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Django version control solutions

2011-01-07 Thread Pēteris Brūns
Hi, I'm seeking for version control solution in django. The most suitable looks django-reversion all other seems dead. Has anybody experience with django-reversion and can comment how successful is this solution, exists other good options to look on? Which from existing solutions is the most e

Re: i18n django models

2011-01-07 Thread Marcos Moyano
I've worked on/with this app https://github.com/Anue/django-polyglot/ Hope it helps. Rgds, Marcos On Fri, Jan 7, 2011 at 12:20 PM, Mo Mughrabi wrote: > Hello, > > in my design there are some models where I need to store certain fields in > different languages. I was wondering if anyone has done

Re: render_to_response format using forms

2011-01-07 Thread Daniel Roseman
On Friday, January 7, 2011 3:15:33 PM UTC, hank23 wrote: > > In the topics forms documentation there's an example of using a form > in a view which shows a return statement using a render_to_respone > shortcut like this: > > return render_to_response('contact.html', { > 'form': form, > })

Re: Django version control solutions

2011-01-07 Thread PeteDK
Hi. I use Django-Reversion and i absolutely love it! :) But I guess it depends on how you're planning on using it? pete On 7 Jan., 16:24, Pēteris Brūns wrote: > Hi, > I'm seeking for version control solution in django. The most suitable > looks django-reversion all other seems dead. Has anybo

Re: render_to_response format using forms

2011-01-07 Thread hank23
So then when using a form do I code it something like this then: return render_to_response('contact.html', { 'form': form, my_data_dictionary, context_instance=RequestContext(request)) }) I ask because it's confusing me when using a form for how to code the form reference while

Re: render_to_response format using forms

2011-01-07 Thread Daniel Roseman
On Friday, January 7, 2011 3:38:10 PM UTC, hank23 wrote: > > So then when using a form do I code it something like this then: > > > return render_to_response('contact.html', { > 'form': form, > my_data_dictionary, > context_instance=RequestContext(request)) > > }) > > > I ask b

creating apps inside sub folders

2011-01-07 Thread Mo Mughrabi
Hi, am trying to organize some commonly used apps in my libs/shared folder inside my project. When I moved the file there, I just appended libs.shared.appname to the INSTALLED_APP and it worked. but the views are not working, i noticed the urls that needed to be appended as well. What else am mis

Re: Django version control solutions

2011-01-07 Thread Pēteris Brūns
Thanks! Some basic use case. Possibility to add remark about created change importance. a) Perfect if possible to build it semiautomatic, some model field value change is important and we can add automatic some importance level for version. b) Also possibility by user set created change importa

Re: render_to_response format using forms

2011-01-07 Thread hank23
I see. So then I would code it something like this then: return render_to_response('contact.html', { my_data_dictionary(including an entry for 'form': form) }, context_instance=RequestContext(request)) On Jan 7, 9:42 am, Daniel Roseman wrote: > On Friday, January 7, 2011 3:38:10 PM UT

Re: Designing a workflow engine on Django

2011-01-07 Thread Javier Guerra Giraldez
On Fri, Jan 7, 2011 at 10:09 AM, Mo Mughrabi wrote: > If am reinventing the wheel and if there is such thing that has been > developed already, any one can suggest, I would be more than happy to go > through it. yes, there are a few ones around there. (as i found after realizing that what i had

Re: render_to_response format using forms

2011-01-07 Thread hank23
Another question about forms. So the form name or names that I pass in the dictionary to the response can also be named anything and aren't required to be of a specific form name format right? On Jan 7, 9:57 am, hank23 wrote: > I see. So then I would code it something like this then: > > return

How do I Bind a Form choice Field?

2011-01-07 Thread hank23
I want to code a form which will have a choice field which I want to have rendered as a dropdown box in my html file. How do I code the choices parameter in the form definition to bind it to a column in one of my data tables in my model? The documentation shows a few examples, but nothing specifica

Re: How do I Bind a Form choice Field?

2011-01-07 Thread Shawn Milochik
On 01/07/2011 11:33 AM, hank23 wrote: I want to code a form which will have a choice field which I want to have rendered as a dropdown box in my html file. How do I code the choices parameter in the form definition to bind it to a column in one of my data tables in my model? The documentation sho

Re: Designing a workflow engine on Django

2011-01-07 Thread Mo Mughrabi
Hi Javier, yeah I saw goFlow, it looks pretty nice. My only concern is the update, if you go to http://code.google.com/p/goflow/downloads/list you notice it has not been updated since 2008 and that is worrying. I don't know if anyone is still maint

Including subfolders

2011-01-07 Thread Mo Mughrabi
Hi, My project is getting quite large with so many apps, so i decided to create a folder for libs/shared and folder for apps in which libs/shared will contain all my generic libraries and apps will contain the project specific apps. I found the following http://solutions.treypiepmeier.com/2009/0

Re: How do I Bind a Form choice Field?

2011-01-07 Thread Daniel Roseman
On Friday, January 7, 2011 4:47:43 PM UTC, ShawnMilo wrote: > > On 01/07/2011 11:33 AM, hank23 wrote: > > I want to code a form which will have a choice field which I want to > > have rendered as a dropdown box in my html file. How do I code the > > choices parameter in the form definition to bind

Re: render_to_response format using forms

2011-01-07 Thread Daniel Roseman
On Friday, January 7, 2011 4:05:27 PM UTC, hank23 wrote: > > Another question about forms. So the form name or names that I pass in > the dictionary to the response can also be named anything and aren't > required to be of a specific form name format right? > Yes, that's correct. There's no nam

Re: Designing a workflow engine on Django

2011-01-07 Thread Javier Guerra Giraldez
On Fri, Jan 7, 2011 at 11:57 AM, Mo Mughrabi wrote: > Any ideas of alternative solutions? sure, a quick googling gives at least: https://github.com/maaku/django-workflow http://pypi.python.org/pypi/django-workflows the last one at least seems quite active. I haven't made up my mind yet on whic

Re: creating apps inside sub folders

2011-01-07 Thread Subhranath Chunder
You can simply append the path to your 'lib/shared' directory to your system path in the settings.py file. sys.path.append(os.path.join(os.path.dirname(__file__), 'lib/shared')) This should do. Thanks, Subhranath Chunder. On Fri, Jan 7, 2011 at 9:20 PM, Mo Mughrabi wrote: > Hi, > > am trying t

Re: Including subfolders

2011-01-07 Thread Subhranath Chunder
On Fri, Jan 7, 2011 at 10:32 PM, Mo Mughrabi wrote: > Hi, > > My project is getting quite large with so many apps, so i decided to create > a folder for libs/shared and folder for apps in which libs/shared will > contain all my generic libraries and apps will contain the project specific > apps.

Generalizing functions in views.py?

2011-01-07 Thread Joe0418
Greetings! I've been spending the past few weeks learning django and love it! I'm running into a snag though... I'm using just one template for all my toying right now, and it has a few sections in it that looks something like this: {% if user.username %} Welcome {{ user.username }}! {

Re: Django admin - action on delete

2011-01-07 Thread Subhranath Chunder
When deleting from the admin interface, the delete is actually on the entire QuerySet rather than on the object level. So if you need to perform some object level modification on the delete action of the admin interface, you can remove the default 'delete_selected' action, and go a custom delete ac

Re: Generalizing functions in views.py?

2011-01-07 Thread Daniel Roseman
On Friday, January 7, 2011 5:19:10 PM UTC, Joe0418 wrote: > > > Greetings! > > I've been spending the past few weeks learning django and love it! I'm > running into a snag though... > > I'm using just one template for all my toying right now, and it has a few > sections in it that looks something

Re: OpenToken Spec & Single Sign On

2011-01-07 Thread Matteius
I don't understand why you would need to use this for server-side authentication in the Django environment? So this OpenToken Single Sign-on appears to be more similar to Django's own django.contrib.auth, and django.contrib.sessions packages, and possibly even less secure (and less documented) tha

Re: How do I Bind a Form choice Field?

2011-01-07 Thread hank23
So I can create a queryset and pass its variable in the choices parameter to bind a modelchoicefield from a modelform to a particular iterable object? So then does this work only with modelforms or with any kind of form (one coded manually as well)? If I can do this with any form then where do I co

slugify override

2011-01-07 Thread galago
How can I override slugify function globally? I want to add some other letters actions especially form my language. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscri

Re: How do I Bind a Form choice Field?

2011-01-07 Thread hank23
So when I would code the queryset parameter in the form definition I would just code something like this: pollquestions = forms.ModelChopiceField(queryset=Poll.objects.all(), ...) when I define the pollquestions field of my form which is ultimately to be rendered into the dropdown box on my form?

Re: OpenToken Spec & Single Sign On

2011-01-07 Thread Justin
Matteo, Thanks for the response. I wish I could just use the django.contrib.auth authentication mechanisms and be done with this. However, I am not looking to use OpenToken to authenticate users in Django, per se. I will be making a Django app that accepts an authentication assertion from another

Re: OpenToken Spec & Single Sign On

2011-01-07 Thread Matteius
Well since that is the case, why even use Django? Why not just do this conversion/forwarding using the existing Perl OpenToken library and deploy it to a cgi-bin? -Matteo On Jan 7, 2:17 pm, Justin wrote: > Matteo, > > Thanks for the response. I wish I could just use the > django.contrib.auth au

Re: How do I Bind a Form choice Field?

2011-01-07 Thread Mike Seidle
Hank - Here's the answer you are looking for: http://docs.djangoproject.com/en/dev/ref/forms/fields/#modelchoicefield Here's an example: stuff = forms.ModelChoiceField(queryset=Series.objects.values('whatever'), empty_label=" ") Spend some serious time learning modelforms. Most of the ti

Re: OpenToken Spec & Single Sign On

2011-01-07 Thread Justin
Well that doesn't seem like much fun! But you're right, that's what will eventually happen. -Justin -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this gro

Re: How do I Bind a Form choice Field?

2011-01-07 Thread hank23
Thanks for the help. On Jan 7, 3:01 pm, Mike Seidle wrote: > Hank - > > Here's the answer you are looking for: > > http://docs.djangoproject.com/en/dev/ref/forms/fields/#modelchoicefield > > Here's an example: > > stuff = forms.ModelChoiceField(queryset=Series.objects.values('whatever'),   > empt

TemplateSyntaxError at /admin/

2011-01-07 Thread hank23
I have coded a new form with a ModelChoiceField defined on it which is getting the following error: TemplateSyntaxError at /admin/ Caught TypeError while rendering: __init__() takes at least 2 arguments (6 given)Request Method: GET Request URL: http://127.0.0.1:8000/admin/ Django Version: 1.2.4 Ex

how to integrate strace on mod_swgi

2011-01-07 Thread zodman
some know how can i integrate the http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Extracting_Python_Stack_Traces but using the WSIHandler of django .. for show output like debuggingtechnique ? -- Andres Vargas www.zodman.com.mx -- You received this message because you are subscribed t

joining across databases

2011-01-07 Thread David
Strictly, joining across databases is usually impossible. However, I'm looking at mechanisms to achieve that functionality and I just wanted to get a sanity check to see that what I'm doing makes sense or if there is a better way. I have one database in Postgres and a legacy database in MSSql. I ha

No module named contact.forms

2011-01-07 Thread marco
i'm reading the djangobook, and doing the example(s). in chapter 7 (forms), when i try to run : >>> from contact.forms import ContactForm the shell gives me this error: Traceback (most recent call last): File "", line 1, in ImportError: No module named contact.forms can you help me to fix th

Serializing Objects with Reverse One-To-One Keys

2011-01-07 Thread Alec Story
I have an object which I want to serialize, which a modules with extra information with a one-to-one key pointing to the main object. I know that I can do a lookup using select_related to get a cache of the relation, but it seems that nothing I do will serialize (to json in my case) these relation

OSUOSL Looking for full-time developer

2011-01-07 Thread LH (Leslie Hawthorn)
Hello, Oregon State University's Open Source Lab is seeking a full-time developer with Django and Python programming skills. The Lab is located in Corvallis, Oregon and employees are required to work on- site. For more information, please see our job posting. [0] [0] - http://osuosl.org/about/new

Curious 500 errors

2011-01-07 Thread Conor
Hello, I am new to Django and working on integrating it with MailChimp. I am implementing call back handlers for their Web Hooks. This should be just views. Anyway, I am testing running the dev server and seeing that the views are called just fine for GET requests, but for POST requests, all I see

Re: TemplateSyntaxError at /admin/

2011-01-07 Thread victorkendy
hi there hank23 to fix the problem you just need to send the queryset parameter to the constructor of the ModelChoiceField pollquestions = forms.ModelChoiceField(queryset=SomeModel, ...other stuff...) works but pollquestions = forms.ModelChoiceField(...other stuff without queryset...) raises the