Re: problems with get_or_create

2010-03-26 Thread Kenneth Gonsalves
thanks for the detailed reply - I now understand the issue. And yes, I did read the documentation, but did not absorb it properly. Use of pyscopg1 is due to inertia. When I was first using django I had a lot of legacy code using psycopg1 and it was too much of a bother to migrate. That code is n

Re: Testing email with the testserver

2010-03-26 Thread Russell Keith-Magee
On Fri, Mar 26, 2010 at 11:29 PM, Ben Gerdemann wrote: > I found the Django documentation about testing E-mail services > confusing. It says here > http://docs.djangoproject.com/en/1.1/topics/testing/#e-mail-services > "Django's test runner automatically redirects all Django-sent e-mail > to a du

Re: Re: Using ModelForm to edit ManyToMany in both directions?

2010-03-26 Thread jwils2004
I believe the answer is to append a regular Form to the ModelForm) with a single ModelMultipleChoice field and use its queryset member to manage the selected volunteers manually. I've found Django to be so good at just having everything I need, I was hoping there would be something out of t

list_display is not working

2010-03-26 Thread Ovnicraft
Hi folks, i am using v1.1.1 on slackware64, i customize th geoadmin, and i change the list_display, i have data loaded and pagination is showed, (test also list_per_page and works ok) but list with records is not showed i want to know how i can identify the problem, this is my code http://dpaste.c

Re: New User - Writing your first Django app part 1 crashed

2010-03-26 Thread Karen Tracey
On Fri, Mar 26, 2010 at 8:52 PM, Paul Harouff wrote: [snip] >connection = zxJDBC.connect(self.jdbc_url(), > zxJDBC.DatabaseError: driver [org.postgresql.Driver] not found > > > All of my searches say the solution is to use the --verify flag with > jython. But, the --verify flag was removed fr

Re: New User - Writing your first Django app part 1 crashed

2010-03-26 Thread Paul Harouff
On Fri, Mar 26, 2010 at 6:26 PM, Karen Tracey wrote: > On Fri, Mar 26, 2010 at 5:58 PM, Paul Harouff wrote: >> >> I uninstalled Django development trunk and installed Django-1.1.1. Now >> when I run "jython manage.py runserver" I get "Error: No module named >> messages" >> > > I've no idea bout y

Default filter value for Admin?

2010-03-26 Thread david.schruth
I'm wondering if there is an easy way to set up a default filter on the rows of my table: 1) at all 2) using a foreign class' field for example. lets say I have a table called 'student' with fields name, gpa, school, etc and another called 'school' with fields name, closed in the case o

Re: Tests for contrib.flatpages

2010-03-26 Thread Bjunix
Thanks for the hint. I'll have a look at this ticket. On Mar 26, 6:38 pm, faldridge wrote: > Bjunix: > > Before you get too far on this, please see the note I attached to your > ticket (cross-referencing ticket #6932).  There has already been some > work done on this issue, and I'd hate for you t

Re: ForeignKeyField

2010-03-26 Thread Asim Yuksel
You know what I am trying to solve this for about 2 days. Thank you so much it worked :) All my respects to your brain :) On 26 Mart, 20:04, Karen Tracey wrote: > On Fri, Mar 26, 2010 at 8:00 PM, Asim Yuksel wrote: > > > I've tried this. > > The model is > > > class Advisors(models.Model): > >  

Re: automatically import lots of modules at python manage.py shell time?

2010-03-26 Thread Bjunix
django-extensions[1] brings the shell_plus command which auto-imports all models in installed apps. You can use this or have a look at it's source. [1] http://github.com/django-extensions/django-extensions On Mar 26, 11:52 pm, "Tom X. Tobin" wrote: > On Fri, Mar 26, 2010 at 5:45 PM, Phlip wrote

Re: ForeignKeyField

2010-03-26 Thread Karen Tracey
On Fri, Mar 26, 2010 at 8:00 PM, Asim Yuksel wrote: > I've tried this. > The model is > > class Advisors(models.Model): > advisorid = models.IntegerField(primary_key=True, > db_column='advisorId') # Field name made lowercase. >maphdid = models.ForeignKey(Tblmaphds, db_column='maPhDId') # >

Re: ForeignKeyField

2010-03-26 Thread Asim Yuksel
I've tried this. The model is class Advisors(models.Model): advisorid = models.IntegerField(primary_key=True, db_column='advisorId') # Field name made lowercase. maphdid = models.ForeignKey(Tblmaphds, db_column='maPhDId') # Field name made lowercase. rank = models.SmallIntegerField()

Re: extend admin interface - chang_list_results.html

2010-03-26 Thread Karen Tracey
On Fri, Mar 26, 2010 at 5:27 PM, Sven Richter wrote: > Ok, just for Information, i found the answer myself. In the django > docs it is said: > "Some of the admin templates, such as change_list_request.html are > used to render custom inclusion tags. These may be overridden, but in > such cases you

Re: New User - Writing your first Django app part 1 crashed

2010-03-26 Thread Karen Tracey
On Fri, Mar 26, 2010 at 5:58 PM, Paul Harouff wrote: > I uninstalled Django development trunk and installed Django-1.1.1. Now > when I run "jython manage.py runserver" I get "Error: No module named > messages" > > I've no idea bout your earlier problem but this one sounds like you are using a set

Re: ForeignKeyField

2010-03-26 Thread Karen Tracey
On Fri, Mar 26, 2010 at 4:31 PM, Asim Yuksel wrote: > here is the list display > > > http://picasaweb.google.com/110428031719333287170/BaslKsZAlbum#5453042316004332754 > > I want that to appear in a list display, because that is what the > client wants :) > > I tried writing unicode method , but i

Re: Testing email with the testserver

2010-03-26 Thread Phlip
Ben Gerdemann wrote: > I am using "manage.py testserver" and Selenium to drive the browser. Therefor you are running thru the real webserver, not its mock. And, incidentally, most testing effort should be in unit tests - Selenium should _only_ test the last mile of integration, where stuff like

Re: automatically import lots of modules at python manage.py shell time?

2010-03-26 Thread Tom X. Tobin
On Fri, Mar 26, 2010 at 5:45 PM, Phlip wrote: > os.environ['DJANGO_SETTINGS_MODULE'] = 'dev2_settings'  #  TODO  look > up which one My local copy actually has the following code in it: import os import re import sys m = re.search(r'^([a-zA-Z0-9_]+)-shell$', os.path.basenam

Re: automatically import lots of modules at python manage.py shell time?

2010-03-26 Thread Phlip
Tom X. Tobin wrote: > #!/usr/bin/env ipython -i -nobanner > Save that to a file in your PATH, make it executable, and you should be set. Awesome--thanks. And, instead of chmod +x-ing it, I added it to our common fab files, so everyone gets it with 'fab shell'. And I could not get ip = IPython.ip

Re: automatically import lots of modules at python manage.py shell time?

2010-03-26 Thread Tom X. Tobin
On Fri, Mar 26, 2010 at 4:47 PM, Phlip wrote: > I am in anguish over watching my colleagues fire up python manage.py > shell... > > ...and then typing several incredibly long import lines before > actually getting anything done. > > These same colleagues also seem to have itchy ^C fingers, meaning

Re: Difference between request.POST.get('foo') and request.POST['foo']?

2010-03-26 Thread Daniel
Thanks guys, that was very clear and helpful. On Mar 24, 2:23 am, Mahmoud Abdelkader wrote: > In python, dictionaries have a get method that will return None if you > call it on a dictionary key that doesn't exist. get() can also take an > optional default parameter that returns it's value if the

Re: New User - Writing your first Django app part 1 crashed

2010-03-26 Thread Paul Harouff
On Fri, Mar 26, 2010 at 2:17 PM, Beartenor1 wrote: > I have a openSUSE linux server. > > Created folder /CSDB. > Dropped copy of Sun jdk6u18 in /CSDB/java/jdk6u18. > Installed copy of Jython in /CSDB/jython > Installed easy_install > Installed distribute > Installed virtualenv > Ran virtualenv --r

automatically import lots of modules at python manage.py shell time?

2010-03-26 Thread Phlip
Djangoists: I am in anguish over watching my colleagues fire up python manage.py shell... ...and then typing several incredibly long import lines before actually getting anything done. These same colleagues also seem to have itchy ^C fingers, meaning they bail out of the shell too often, too. H

Re: extend admin interface - chang_list_results.html

2010-03-26 Thread Sven Richter
Ok, just for Information, i found the answer myself. In the django docs it is said: "Some of the admin templates, such as change_list_request.html are used to render custom inclusion tags. These may be overridden, but in such cases you are probably better off creating your own version of the tag in

Re: ForeignKeyField

2010-03-26 Thread Asim Yuksel
here is the list display http://picasaweb.google.com/110428031719333287170/BaslKsZAlbum#5453042316004332754 I want that to appear in a list display, because that is what the client wants :) I tried writing unicode method , but it has no effect.I dont know why.And when I try to use maphdid_id, it

New User - Writing your first Django app part 1 crashed

2010-03-26 Thread Beartenor1
I have a openSUSE linux server. Created folder /CSDB. Dropped copy of Sun jdk6u18 in /CSDB/java/jdk6u18. Installed copy of Jython in /CSDB/jython Installed easy_install Installed distribute Installed virtualenv Ran virtualenv --relocatable /CSDB/jython Dropped copy of Apache tomcat6 in /CSDB/tomca

Re: xmlrpc + 'django.contrib.auth.middleware.RemoteUserMiddleware' throws "Forbidden"

2010-03-26 Thread David
> Are you telling me that there's no way to get this workin without an apache in front of django? So, all the questions I'm going to ask you at the end of this email have only this answer? :) That's pretty much true although it isn't Apache specific. Lots of other web servers have a way of setting

Re: About extending User model

2010-03-26 Thread Jim N
Carl, scratch my last message. It does work. Woot! Thanks very much. On Mar 26, 2:39 pm, Jim N wrote: > On Mar 26, 1:39 pm, Carl Zmola wrote: > > > > > > > On 03/25/2010 02:37 PM, Jim N wrote: > > > Very interesting, Tom. > > > > I have inserted this code, substituting my profile model name >

Re: About extending User model

2010-03-26 Thread Jim N
On Mar 26, 1:39 pm, Carl Zmola wrote: > On 03/25/2010 02:37 PM, Jim N wrote: > > Very interesting, Tom. > > > I have inserted this code, substituting my profile model name > > (QotdUser) for UserProfile.  It does create a row in QotdUser, but the > > row is empty of course. > > > More importantly,

extend admin interface - chang_list_results.html

2010-03-26 Thread Sven Richter
Hi, i am about to extend the admin interface and came to the following problem. I want to add some information to the overview of an application model. Now, i look in the change_list.html and see that the {% result_list cl %} template tag is the one i need to adapt. Now, when i look in the templ

Re: About extending User model

2010-03-26 Thread Carl Zmola
On 03/25/2010 02:37 PM, Jim N wrote: Very interesting, Tom. I have inserted this code, substituting my profile model name (QotdUser) for UserProfile. It does create a row in QotdUser, but the row is empty of course. More importantly, if I create a user via the admin interface (http:// 127.0

Re: Tests for contrib.flatpages

2010-03-26 Thread faldridge
Bjunix: Before you get too far on this, please see the note I attached to your ticket (cross-referencing ticket #6932). There has already been some work done on this issue, and I'd hate for you to waste any time re- duplicating effort. On Mar 26, 11:06 am, Bjunix wrote: > Thanks for your answer

Re: auto authenticate

2010-03-26 Thread CrabbyPete
Thanks Peter that is exactly what I was looking for. On Mar 25, 5:12 pm, Peter Bengtsson wrote: > If what you want to achieve is to log in a user programmatically you > don't do that by authenticating by username and password. > Example: > > def login_by_id(request): > >            user = Faceboo

Re: xmlrpc + 'django.contrib.auth.middleware.RemoteUserMiddleware' throws "Forbidden"

2010-03-26 Thread Simone Orsi
Hi David, Ale, thanks for your answers :) On 03/26/2010 05:24 PM, David wrote: > Simone, > > It looks to me like there may be a problem in how you have configured > basic authentication on your web server. At the moment I didn't configure any server at all :) > Firstly, the fact that you > are ab

Re: ForeignKeyField

2010-03-26 Thread Daniel Roseman
On Mar 26, 4:44 pm, Asim Yuksel wrote: > Yes foreignkey is an object but there must be a way to display the > value in a list_display. I am a newbie too. self.maphdid.id doesnt > work The underlying id field is called "maphdid_id", so you should be able to use that. But I have no idea why you'd w

Re: ForeignKeyField

2010-03-26 Thread Asim Yuksel
Yes foreignkey is an object but there must be a way to display the value in a list_display. I am a newbie too. self.maphdid.id doesnt work On 26 Mart, 06:05, Thierry Chich wrote: > Le vendredi 26 mars 2010 04:14:51, Asim Yuksel a écrit : > > > I have a question about model.ForeignKey field.Foreig

Re: Is it possible to change the width of the boxes displayed by the filter_horizontal in Django admin interface?

2010-03-26 Thread Walt
I'm sorry I wasn't more clear, the class Media just gets added to your existing admin class. The path to the css should be the path that is appended to your SETTINGS.PY media path to reach the css file. The class ResizeFilterAdmin was just an example name. In other words, if your media path is: /v

Re: Uploading CSV file via ModelForm and then getting info and storing in a different model

2010-03-26 Thread Chris McComas
So I resolved the previous issue, not i'm getting this error, newline in string. http://dpaste.com/176429/ Any idea? I'm thinking for some reason I need to change something in reader = csv.reader(file, delimiter=',', quotechar='"') On Mar 26, 10:27 am, Chris McComas wrote: > derek, > > thanks

Re: Any way to have a ModelForm tied to 2 Models?

2010-03-26 Thread bruno desthuilliers
On Mar 26, 5:07 pm, Continuation wrote: > So I can have 2 forms with 1 submit buttons, right? > > For some reason I was under the impression that there has to be an 1:1 > correspondence. Form objects don't generate the markup for and submit buttons parts - this is something you have to by your

Re: xmlrpc + 'django.contrib.auth.middleware.RemoteUserMiddleware' throws "Forbidden"

2010-03-26 Thread David
Simone, It looks to me like there may be a problem in how you have configured basic authentication on your web server. Firstly, the fact that you are able to connect to your unprotected methods without using the username "admin" with password "admin" leads me to believe that your server is unprote

Re: Any way to have a ModelForm tied to 2 Models?

2010-03-26 Thread Continuation
So I can have 2 forms with 1 submit buttons, right? For some reason I was under the impression that there has to be an 1:1 correspondence. On Mar 26, 6:36 am, Russell Keith-Magee wrote: > On Fri, Mar 26, 2010 at 9:11 AM, Continuation wrote: > > I have 2 models: A, B > > > I need a form that in

Re: Tests for contrib.flatpages

2010-03-26 Thread Bjunix
Thanks for your answer, I created a ticket for this here: http://code.djangoproject.com/ticket/13219 I am new to testing django apps, but maybe I'll have a try on some tests for flatpages. On Mar 26, 4:02 pm, Russell Keith-Magee wrote: > On Fri, Mar 26, 2010 at 9:42 PM, Bjunix wrote: > > Hi a

Re: Passing context variables from template to view

2010-03-26 Thread Bill Freeman
Actually, by the time your user can click a button the "result-set" is no longer around, because the context is no longer around (render and the view function have returned). All that's left is the rendered representation. I see two possibilities: 1. You render the data into a hidden form which

Re: Grouped statements in debug_toolbar

2010-03-26 Thread Peter Bengtsson
On 26 March 2010 11:09, Daniel Roseman wrote: > On Mar 25, 7:17 pm, Peter Bengtsson wrote: >> The old django debug-toolbar used to make it possible to group >> statements that were the same so you can see if a particular statement >> was called repeatedly. This does not appear to be possible in t

Testing email with the testserver

2010-03-26 Thread Ben Gerdemann
I found the Django documentation about testing E-mail services confusing. It says here http://docs.djangoproject.com/en/1.1/topics/testing/#e-mail-services "Django's test runner automatically redirects all Django-sent e-mail to a dummy outbox", but the example code shows using the 'mail' object di

Re: Project with main site and sub-domains

2010-03-26 Thread John Wesonga
I've opted to try out multiple instances of Django, and using mod_wsgi +Apache+Nginx I was able to create Virtual Hosts and the apps work well. What I'm now testing is the sites framework and wondering if I have a model Articles that is shared across the sites, do I need to create the model twice i

Re: Let Django form render field's with custom attributes (e.g CSS)?

2010-03-26 Thread Thierry
Thanks for the feedbacks. And yes unfortunately I am bound to support our "official corporate browser" IE6, otherwise I would have happily gone to a more CSS-only direction. What puzzles me most is that method BoundField.label_tag() has an attr(ibute)s argument and some code to support it, but ther

Re: xmlrpc + 'django.contrib.auth.middleware.RemoteUserMiddleware' throws "Forbidden"

2010-03-26 Thread Alessandro Pasotti
2010/3/26 Simone Orsi > Hi *, > > I'm trying to set some webservices using rpc4django (cause it supports > also jSON) on Django 1.1. > > I followed this > > http://packages.python.org/rpc4django/#overview > > and this > > http://docs.djangoproject.com/en/1.1/howto/auth-remote-user/ > > so that in

Re: Tests for contrib.flatpages

2010-03-26 Thread Russell Keith-Magee
On Fri, Mar 26, 2010 at 9:42 PM, Bjunix wrote: > Hi all, > > I am looking for tests for the flatpages app. I can't find any. Do I > miss something or ships django without tests for flatpages? You're not missing anything; for historical reasons (specifically, that flatpages was written before Djan

Re: Problem with cross-database foreign-keys and select_related

2010-03-26 Thread Russell Keith-Magee
On Fri, Mar 26, 2010 at 10:54 PM, greatlemer wrote: > Hi, > > I'm running the django 1.2 beta and am testing out the multi-db > system.  Unfortunately I have run into an issue where I have: > > class A(models.Model): >    name = models.CharField() >     > > class B(models.Model): >    a = models.F

Problem with cross-database foreign-keys and select_related

2010-03-26 Thread greatlemer
Hi, I'm running the django 1.2 beta and am testing out the multi-db system. Unfortunately I have run into an issue where I have: class A(models.Model): name = models.CharField() class B(models.Model): a = models.ForeignKey(A) I also have database routers set up so that A item

xmlrpc + 'django.contrib.auth.middleware.RemoteUserMiddleware' throws "Forbidden"

2010-03-26 Thread Simone Orsi
Hi *, I'm trying to set some webservices using rpc4django (cause it supports also jSON) on Django 1.1. I followed this http://packages.python.org/rpc4django/#overview and this http://docs.djangoproject.com/en/1.1/howto/auth-remote-user/ so that in my settings.py I have MIDDLEWARE_CLASSES = (

Re: Let Django form render field's with custom attributes (e.g CSS)?

2010-03-26 Thread David De La Harpe Golden
On 26/03/10 13:18, Thierry wrote: Hi, I want to differentiate CSS style of fields from the style of RadioSelects elements (as rendered through RadioFieldRenderer). Immediate action: I could create my RadioFieldRenderer/RadioInput classes to display inner labels as. Any direction you could

Re: Uploading CSV file via ModelForm and then getting info and storing in a different model

2010-03-26 Thread Chris McComas
derek, thanks, that's a bit much for what we need. i setup this in my views: http://dpaste.com/176380/ I'm getting this error: http://dpaste.com/176382/ How can I get it to open the file that was just uploaded and saved? On Mar 26, 9:27 am, derek wrote: > On Mar 26, 1:54 pm, Chris McComas w

Re: Deleted blog posts not disappearing

2010-03-26 Thread Karen Tracey
On Fri, Mar 26, 2010 at 9:32 AM, grimmus wrote: > In the view: > > diary = Entry.objects.filter(status=1).order_by('-pub_date')[:5] > > t = loader.get_template('cms/page.html') > c = RequestContext(request,{ > 'diary':diary, > }) > return HttpResponse(t.render(c)) > Is that diary = line real

Re: Let Django form render field's with custom attributes (e.g CSS)?

2010-03-26 Thread Xavier Ordoquy
Hello, I believe {{form.as_ul}} is for prototypes but once you get deeper into the project you most probably want to throw it, only use {{form.field}} and define label in html within your template. Xavier. Le 26 mars 2010 à 14:18, Thierry a écrit : > Hi, > > I want to differentiate CSS style

Tests for contrib.flatpages

2010-03-26 Thread Bjunix
Hi all, I am looking for tests for the flatpages app. I can't find any. Do I miss something or ships django without tests for flatpages? -- 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...@googlegro

Re: Extending the admin - add 'save and go to next' button

2010-03-26 Thread derek
On Mar 26, 12:13 pm, filias wrote: > Hi, > > I want to extend the admin by adding a 'Save/Next' button next to the > default 'Save' button. > > This action would save the instance and show the next instance (if it > exists) or go back to the list. > > What is the best way to do it? Is there any po

Re: Deleted blog posts not disappearing

2010-03-26 Thread grimmus
In the view: diary = Entry.objects.filter(status=1).order_by('-pub_date')[:5] t = loader.get_template('cms/page.html') c = RequestContext(request,{ 'diary':diary, }) return HttpResponse(t.render(c)) And the template {% for entry in diary %}

Re: Uploading CSV file via ModelForm and then getting info and storing in a different model

2010-03-26 Thread derek
On Mar 26, 1:54 pm, Chris McComas wrote: > I have to models, one is just a timestamp field and a file, the other > has some information. I need to create a view that'll allow our staff > to upload a CSV and then it'll automatically take that info and save > it into the second model. I found > thi

Let Django form render field's with custom attributes (e.g CSS)?

2010-03-26 Thread Thierry
Hi, I want to differentiate CSS style of fields from the style of RadioSelects elements (as rendered through RadioFieldRenderer). Immediate action: I could create my RadioFieldRenderer/RadioInput classes to display inner labels as . But (and this is mostly my point of raising the issue), I was

Re: Using ModelForm to edit ManyToMany in both directions?

2010-03-26 Thread Wilberoni
Clarification: I'd like to see a Multi-select widget containing ALL the volunteers, with those who currently have the job selected. I'd like to them be able to select additional volunteers for that job or unselect existing ones. Wilb -- You received this message because you are subscribed to t

Re: Deleted blog posts not disappearing

2010-03-26 Thread Daniel Roseman
On Mar 26, 11:25 am, grimmus wrote: > Hi, > > I have a website with 5 pages and a blog. > > At the bottom of every page is a list of recent blog posts. > > When i delete some blog posts they still appear in the recent posts > list. > > I am not using any caching. > > If i restart the local dev ser

Uploading CSV file via ModelForm and then getting info and storing in a different model

2010-03-26 Thread Chris McComas
I have to models, one is just a timestamp field and a file, the other has some information. I need to create a view that'll allow our staff to upload a CSV and then it'll automatically take that info and save it into the second model. I found this http://blog.2theleft.la/2010/02/9/importing-csv-fil

Project with main site and sub-domains

2010-03-26 Thread John Wesonga
Hi, I'm working on a web project where the organization will have a main site like http://www.nameoforg.net and sub-sites (subdomains) like http://proj1.nameoforg.net. Some of the content in the sub-domains like Case Studies, Resources should be viewable in the Main website. I've looked at the Dja

django-simplepages "stable"?

2010-03-26 Thread Ivan Uemlianin
Dear All I need a basic CMS and django-simplepages looks like it should fit the bill. I notice it hasn't had any changes since Aug 2008, or issues posted since Feb 2009. Does this mean it's "stable" or "broken"? Is anyone using it? I've noticed an error in simplepages/models.py: 5from dj

Re: Any way to have a ModelForm tied to 2 Models?

2010-03-26 Thread Matt Schinckel
On Mar 26, 11:11 am, Continuation wrote: > I have 2 models: A, B > > I need a form that inserts/updates both fields of A and fields of B. > > Is there any way to create a ModelForm tied to A & B? Or do I need to > use the plain old Form? You can use a ModelForm on one, and add the extra fields to

Deleted blog posts not disappearing

2010-03-26 Thread grimmus
Hi, I have a website with 5 pages and a blog. At the bottom of every page is a list of recent blog posts. When i delete some blog posts they still appear in the recent posts list. I am not using any caching. If i restart the local dev server then they disappear. Could anyone tell me why this

Re: problems with get_or_create

2010-03-26 Thread Karen Tracey
On Fri, Mar 26, 2010 at 1:49 AM, Kenneth Gonsalves wrote: > Here is what I mean - A simple model with two fields, 'name' is unique, > and 'num' is not null: > > >>> Tm.objects.get_or_create(name='me',num=1) > (, True) > >>> Tm.objects.get_or_create(name='me',num=2) > If you want get_or_create to

DateFormat and localization

2010-03-26 Thread Wim Feijen
Hi, I'm unsure if and how to use DateFormat from django/utils/ dateformat.py . I'd like to use a local (Dutch) representation of dates. What I get is: u'26th March 2010' I'd like that to be in Dutch. How do I do that? Major thanks! Wim My IPython looks like this: In [1]: import datetime

Re: Grouped statements in debug_toolbar

2010-03-26 Thread Daniel Roseman
On Mar 25, 7:17 pm, Peter Bengtsson wrote: > The old django debug-toolbar used to make it possible to group > statements that were the same so you can see if a particular statement > was called repeatedly. This does not appear to be possible in the > latest version; or am I wrong? I don't think t

post_syncdb signal

2010-03-26 Thread Sławek Tuleja
Hi all! In my application i have mutable and immutable components. After sync_db command i use post_syncdb singal to create table with info about this components. How to pass new attr about component to register_component function established with post_syncdb signal? code: # Page models are imm

Re: help needed in ModelForm __unicode__

2010-03-26 Thread Kenneth Gonsalves
On Friday 26 Mar 2010 3:38:10 pm Emanuel wrote: > both combo's. > I want to filter only men or women depending the case. Is it possible? Or > should I create another method for independent cases? If it is the > solution how can I use it? I'm not getting there because it is a instance > of a cla

Re: help needed in ModelForm __unicode__

2010-03-26 Thread Daniel Roseman
On Mar 26, 10:08 am, Emanuel wrote: > Hi! > > I Have this model: > class Person(models.Model): >     user = models.ForeignKey(User) >     nr = models.IntegerField(blank=True,) >     gender = models.CharField(max_length=1, blank=True, > choices=gender_choices) > >     def __unicode__(self): >      

session

2010-03-26 Thread nadae ivar
Hi Guys, i'm new in django and i want to use the session in my application. Someone can help me ? i already enabled session in the middelware but i want to fix the session expire times. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

help needed in ModelForm __unicode__

2010-03-26 Thread Emanuel
Hi! I Have this model: class Person(models.Model): user = models.ForeignKey(User) nr = models.IntegerField(blank=True,) gender = models.CharField(max_length=1, blank=True, choices=gender_choices) def __unicode__(self): return self.user.get_full_name() I'm using

Re: Any way to have a ModelForm tied to 2 Models?

2010-03-26 Thread Russell Keith-Magee
On Fri, Mar 26, 2010 at 9:11 AM, Continuation wrote: > I have 2 models: A, B > > I need a form that inserts/updates both fields of A and fields of B. > > Is there any way to create a ModelForm tied to A & B? Or do I need to > use the plain old Form? Why not just use two forms? There's no limitati

Extending the admin - add 'save and go to next' button

2010-03-26 Thread filias
Hi, I want to extend the admin by adding a 'Save/Next' button next to the default 'Save' button. This action would save the instance and show the next instance (if it exists) or go back to the list. What is the best way to do it? Is there any post on best practices on these topic or other admin

Re: ForeignKeyField

2010-03-26 Thread Thierry Chich
Le vendredi 26 mars 2010 04:14:51, Asim Yuksel a écrit : > I have a question about model.ForeignKey field.Foreign key fields are > shown as object in admin page. How can I show them in other types like > integer type > for example I have a Model like this: > > class Advisor(models.Model): > >

Re: Any way to have a ModelForm tied to 2 Models?

2010-03-26 Thread bruno desthuilliers
On Mar 26, 2:11 am, Continuation wrote: > I have 2 models: A, B > > I need a form that inserts/updates both fields of A and fields of B. > > Is there any way to create a ModelForm tied to A & B? Or do I need to > use the plain old Form? A possible solution would be to wrap both ModelForms in a "f

Re: How to locate the OS user name? [newbie]

2010-03-26 Thread Baurzhan Ismagulov
On Thu, Mar 25, 2010 at 11:32:46PM -0700, BobAalsma wrote: > So I think now the question seems to be "how to extract the OS user > name from the browser environment?" If you don't mind logging in once, a cookie could be one solution (Django does this by default, AFAIK). With kind regards, -- Bau

Re: Django 1.2b multidatabase + manytomany relationship

2010-03-26 Thread Russell Keith-Magee
On Wed, Mar 24, 2010 at 6:16 PM, mbdtsmh wrote: > Hi All, still trying to get my head around the multi db stuff in 1.2 > release. > > Here is my problem that I have hit upon. > > I have a model in my default db... > > class Set1(models.Model): >    create_date = models.DateTimeField(auto_now_add='

Re: tests fail for django.contrib.auth

2010-03-26 Thread Russell Keith-Magee
2010/3/24 Filip Gruszczyński : > When I run all tests, tests for django.contrib.auth. I tried googling > it and found information, that django.contrib.sites is required, but I > have this app installed. I was also advised to use > TEMPLATE_CONTEXT_LOADERS, but this didn't help. Have anyone > encoun

Re: How to locate the OS user name? [newbie]

2010-03-26 Thread BobAalsma
In addition: So maybe Baurzhan was right: using a database login (explicit or implicit) could be the easier solution to build. Regards, Bob On Mar 26, 7:32 am, BobAalsma wrote: > Hmm, on second thoughts... > > I tested from the shell in a few user environements and it worked. > > However, when a

Re: High, ongoing CPU consumption

2010-03-26 Thread David Christiansen
Thank you very much, Graham. I'll do some more looking and get back to the list. /David Christiansen -- 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 g