Re: A ManyToMany Field question.

2009-02-10 Thread khsing
class user(models.Model): username = models.CharField(max_length=50) class group(models.Model): groupname = models.CharField(max_length=50) users = models.ManyToManyField(user) groups = models.ManyToManyField('self') there are my models. I have no idea to get a complete group li

Re: comparisons with java framework

2009-02-10 Thread igorlash
Russ Magee , I've got a question personally to you. Why do we need to use make ? Why this build can't be done without make but only with python ? A lot of companies try to avoid using make and moving projects to python as build tool. On Feb 11, 1:59 am, Russell Keith-Magee wrote: > On Tue, Feb 1

Re: Problems with djangosearch setup

2009-02-10 Thread Praveen
SEARCH_ENGINE is not able to find solr. i think some thing wrong in your configuration or try to change the case SOLR 'Solr' some thing like that On Feb 11, 6:15 am, Shantp wrote: > Hi > > I've installed Java, Tomcat and Solr. I followed the directions and > got pysolr as well. I put the djangos

Save Local image with model

2009-02-10 Thread rane
Hi, I've a model with imagefield which I am easily able to save using request.FILES. I have some images which are already uploaded (on the server at a known path), I want to save them with the model. When i save the model, the save method also creates thumbnails, which is why I want to save the up

Associating content with multiple sites

2009-02-10 Thread Praveen
lets assume all in lowercase expo/expoapp/models.py class events(models.Model): title = models.CharField(max_length = 50) summary = models.CharField(max_length = 100) description = models.CharField(max_length = 300) event_type = models.ForeignKey(event_ty

Re: I may have found a bug in inlineformset_factory vicinity

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 5:37 PM, Skylar wrote: > > I get rendered > Id also > User > This is a rather huh?-inducing start to a bug report. Without context, those two outputs look perfectly fine. It really helps if you start with what you are doing at a high level, the code you are using to atte

Re: executing raw sql results in traceback

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 10:28 PM, Bobby Roberts wrote: > > hi gang. For various reasons i've decided to use a raw sql statement > in my view. Following the example located at > http://docs.djangoproject.com/en/dev/topics/db/sql/, I have a view > which looks like this: > > > def searchform(reque

Re: dynamic ModelChoiceField and handling form submission

2009-02-10 Thread wynfred
> The issue is you are passing the kwarg "user" after the arg.  Since user is > the first param when you pass request.POST as the first arg it assumes it is > user.  Reorganize your arguments in some(make user first, or pass > request.POST as a kwarg) way. > > Alex Thanks, Alex. That was a huge h

Re: KML geodjango plz help!

2009-02-10 Thread Greg Aumann
On Feb 10, 6:06 pm, arbi wrote: > I am a newb in Django/GeoDjango. > I am making the tutorial here :http://code.djangoproject.com/wiki/GeoDjango > and I use mySQL as a database. The project is to store places in a > database, then to display it on a OpenLayer Map (like Google Maps) > > Does any o

Re: version control convention?

2009-02-10 Thread Jeff Anderson
Serdar T. wrote: > Is it better to create repositories at a site-, project- or app-level? > Technically, you can do all three. Definitely put all of your re-usable apps into their own repository. I always put my projects into their own repository, but I don't necessarily include apps that I'm

Re: date error

2009-02-10 Thread Hervé Edorh
thank you Mr Morales it work --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to djan

executing raw sql results in traceback

2009-02-10 Thread Bobby Roberts
hi gang. For various reasons i've decided to use a raw sql statement in my view. Following the example located at http://docs.djangoproject.com/en/dev/topics/db/sql/, I have a view which looks like this: def searchform(request): from django.db import connection ... # a massive sql statem

Problems with djangosearch setup

2009-02-10 Thread Shantp
Hi I've installed Java, Tomcat and Solr. I followed the directions and got pysolr as well. I put the djangosearch app on my python path and put it in the installed_apps in my settings.py. http://code.google.com/p/djangosearch/source/browse/branches/soc-new-backends/doc/README.txt In the read me

Re: Stupid Newbie ManyToManyField Contains question

2009-02-10 Thread bkev
Hmm... That sort of works, but not quite. If I use the filter method, it won't properly set the jumbledname on the first save. However, if I go back in and save the instance again a second time, it will properly set jumbledname. If I had it to guess, (after looking at the Django documentation) it'

Re: Bizarre sqlite3 / apache2 behaviour

2009-02-10 Thread lazyant
Thanks a lot Jeff. I figured out the problem which was a bit more complicated than that but basically was also what you said. I downloaded the sqlite3 client and that helped too. What throw me off (among other things) is that in Linux you only need executable permissions to a directory and writ

Re: where's our poll app?

2009-02-10 Thread Tim Johnson
On Tuesday 10 February 2009, djandrow wrote: > Did you create the models and is the database correctly configured in > settings.py? I added 'phhsite.polls', the server is seeing it now. Thanks :-) stayed tuned - I'm an old pythonisto in more ways than one, but just a django noob cheers tj

Re: comparisons with java framework

2009-02-10 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 8:41 PM, igorlash wrote: > > The django community should allow to download html version of > documentation to make this project more attractive , I'm sure it > doesn't take a lot of time to generate it on configured environment. You're sure, are you? Have you actually wri

Re: where's our poll app?

2009-02-10 Thread djandrow
Did you create the models and is the database correctly configured in settings.py? On 10 Feb, 22:55, Tim Johnson wrote: > It's not displayed on the admin index page. > > From the Tutorial > at:http://docs.djangoproject.com/en/dev/intro/tutorial02/#intro-tutorial02 > > Name of the project is phh

Re: How do I display the human readable name of a choice?

2009-02-10 Thread Alex Gaynor
On Tue, Feb 10, 2009 at 6:39 PM, Kevin Audleman wrote: > > Thanks Alex, however this is a solution at the View level, and I'm > using a view that I didn't write. Is there also a way to do this at > the template level? > > Thanks again, > Kevin > > On Feb 10, 1:24 pm, Alex Gaynor wrote: > > On Tue

Re: How do I display the human readable name of a choice?

2009-02-10 Thread Kevin Audleman
Thanks Alex, however this is a solution at the View level, and I'm using a view that I didn't write. Is there also a way to do this at the template level? Thanks again, Kevin On Feb 10, 1:24 pm, Alex Gaynor wrote: > On Tue, Feb 10, 2009 at 4:23 PM, Kevin Audleman > wrote: > > > > > > > Hi ever

Best way to deal with dictionaries of lists (equivalent of SQL GROUP BY)

2009-02-10 Thread Adam Nelson
I'm looking at the documentation here: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#regroup And am looking for the best practices way to deal with doing that from within the manager. This seems like a common issue: 1. I have two models, one foreign keys to the other (comments -

Re: comparisons with java framework

2009-02-10 Thread Russell Keith-Magee
On Wed, Feb 11, 2009 at 6:52 AM, Greg Ewing wrote: > > Alex Gaynor wrote: > >> As I said above, a checkout of the django source includes all the docs, >> which can be built into nice HTML just as online with the sphinx module >> for python. It takes all of 30 seconds. > > Only if you have all th

KML geodjango plz help!

2009-02-10 Thread arbi
Hi all! I am a newb in Django/GeoDjango. I am making the tutorial here : http://code.djangoproject.com/wiki/GeoDjango and I use mySQL as a database. The project is to store places in a database, then to display it on a OpenLayer Map (like Google Maps) The problem is that I get a : Exception Type

where's our poll app?

2009-02-10 Thread Tim Johnson
It's not displayed on the admin index page. >From the Tutorial at: http://docs.djangoproject.com/en/dev/intro/tutorial02/#intro-tutorial02 Name of the project is phhsite from phhsite ran python manage.py startapp polls directory was created. Then created the admin file Restarted the server by f

Re: Json Serialization / Form Validation error

2009-02-10 Thread adrian
Thank you all for posting this. You saved me probably hours of head scratching. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com

I may have found a bug in inlineformset_factory vicinity

2009-02-10 Thread Skylar
I get rendered Id also User ### The mostly relevent part of views.py: from django.forms.models import inlineformset_factory @login_required def pickup(request): try: profile = request.user.get_profile() except: return HttpResponseRedirect('/profile/') PickUpFormSet =

Re: Cookie authentication

2009-02-10 Thread Sylvain
Hello everybody, I still haven't found any solution for this problem, although it seems quite simple and common... any idea ? Thank you ! On 26 jan, 13:15, Sylvain wrote: > Hello everybody, > > I'm trying to create a cookie-based authentication so that the users > don't have to login each time

Re: Another thread about static content

2009-02-10 Thread djandrow
I've move it just to the apache2.2 file so my conf is now: Options Indexes FollowSymLinks SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE akonline.settings PythonOption django.root /akonline PythonDebug On PythonPath "

Re: comparisons with java framework

2009-02-10 Thread Alex Gaynor
On Tue, Feb 10, 2009 at 4:52 PM, Greg Ewing wrote: > > Alex Gaynor wrote: > > > As I said above, a checkout of the django source includes all the docs, > > which can be built into nice HTML just as online with the sphinx module > > for python. It takes all of 30 seconds. > > Only if you have all

Re: Another thread about static content

2009-02-10 Thread djandrow
So would it be best to move my project somewhere else? On 10 Feb, 21:48, Ramiro Morales wrote: > On Tue, Feb 10, 2009 at 7:40 PM, djandrow wrote: > > > Hello all, > > > I know theres alot of threads like this out there but I'm still > > struggling. I've got a simple html template which i access

Re: comparisons with java framework

2009-02-10 Thread Greg Ewing
Alex Gaynor wrote: > As I said above, a checkout of the django source includes all the docs, > which can be built into nice HTML just as online with the sphinx module > for python. It takes all of 30 seconds. Only if you have all the necessary tools and dependencies installed and working, whi

Re: Stupid Newbie ManyToManyField Contains question

2009-02-10 Thread Alex Gaynor
On Tue, Feb 10, 2009 at 4:48 PM, bkev wrote: > > Hmm...It is just a normal python string, but when I try 'Smith' in > self.lastname, I get a "ManyRelatedManager is not iterable" error. Any > ideas? > > Thanks again, > -bkev > > > Sorry I'm an idiot, I read lastname in the wrong place, what you'll

Re: Stupid Newbie ManyToManyField Contains question

2009-02-10 Thread bkev
Hmm...It is just a normal python string, but when I try 'Smith' in self.lastname, I get a "ManyRelatedManager is not iterable" error. Any ideas? Thanks again, -bkev --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: Another thread about static content

2009-02-10 Thread Ramiro Morales
On Tue, Feb 10, 2009 at 7:40 PM, djandrow wrote: > > Hello all, > > I know theres alot of threads like this out there but I'm still > struggling. I've got a simple html template which i access through a > view: > > > > > > the template is in C:/Program Files/Apache2.2/htdocs/akonline/ > templa

Another thread about static content

2009-02-10 Thread djandrow
Hello all, I know theres alot of threads like this out there but I'm still struggling. I've got a simple html template which i access through a view: the template is in C:/Program Files/Apache2.2/htdocs/akonline/ templates/blogSite and the image is then in blogSite/media then in my conf I h

Re: date error

2009-02-10 Thread Ramiro Morales
On Tue, Feb 10, 2009 at 6:51 PM, Hervé Edorh wrote: > > nobody for helping me? It seems you have several problems: First, the code you are pasting has the indentation totally broken. Second, >i forgot, the first ulrs.py (in the project directory) is like this > > (r'^weblog/$',include('dibon

JODConverter with Django

2009-02-10 Thread Tonu Mikk
I am curious if anyone is using JODConverter http://www.artofsolving.com/opensource/jodconverter in their Django project? I would be interested in learning from your experience. Thanks, Tonu --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: How do I display the human readable name of a choice?

2009-02-10 Thread Alex Gaynor
On Tue, Feb 10, 2009 at 4:23 PM, Kevin Audleman wrote: > > Hi everyone, > > I've set up a model that has a state field with the input set to a > list of states, > > state = models.CharField(max_length=100, blank=True, > choices=US_STATE_LIST) > > The drop-down on the edit form works great, display

How do I display the human readable name of a choice?

2009-02-10 Thread Kevin Audleman
Hi everyone, I've set up a model that has a state field with the input set to a list of states, state = models.CharField(max_length=100, blank=True, choices=US_STATE_LIST) The drop-down on the edit form works great, displaying 'Alabama' and storing AL in the database. However when I view it, I

Re: comparisons with java framework

2009-02-10 Thread Alex Gaynor
On Tue, Feb 10, 2009 at 4:15 PM, Greg Ewing wrote: > > Russell Keith-Magee wrote: > > > No - we don't provide a PDF version of the documentation. This idea > > has been proposed a few times in Django's history, but it has been > > rejected in favour of providing the tools to let people build offli

Re: comparisons with java framework

2009-02-10 Thread Greg Ewing
Russell Keith-Magee wrote: > No - we don't provide a PDF version of the documentation. This idea > has been proposed a few times in Django's history, but it has been > rejected in favour of providing the tools to let people build offline > versions by themselves. What about an offline HTML versi

Re: Stupid Newbie ManyToManyField Contains question

2009-02-10 Thread Alex Gaynor
On Tue, Feb 10, 2009 at 4:07 PM, bkev wrote: > > Hello all, > > Is there a way to check whether a field contains a certain value in a > ManyToManyField in the admin on a custom save method? For example, I > have a model like: > > class LastName(models.Model): >lastname = models.CharField(...)

Stupid Newbie ManyToManyField Contains question

2009-02-10 Thread bkev
Hello all, Is there a way to check whether a field contains a certain value in a ManyToManyField in the admin on a custom save method? For example, I have a model like: class LastName(models.Model): lastname = models.CharField(...) class Person(models.Model): firstname = models.CharField

Re: date error

2009-02-10 Thread Hervé Edorh
nobody for helping me? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-use

Re: dynamic ModelChoiceField and handling form submission

2009-02-10 Thread Alex Gaynor
On Tue, Feb 10, 2009 at 3:24 PM, wynfred wrote: > > I'm sure there is a simple solution here, but I've been searching the > forum archive and elsewhere but so far haven't found an answer. > > I have a form that uses some dynamic ModelChoiceField fields, > filtering the model for the logged-in use

dynamic ModelChoiceField and handling form submission

2009-02-10 Thread wynfred
I'm sure there is a simple solution here, but I've been searching the forum archive and elsewhere but so far haven't found an answer. I have a form that uses some dynamic ModelChoiceField fields, filtering the model for the logged-in user. The form in app's forms.py, slightly abridged, is like t

Re: user defined model

2009-02-10 Thread Jeff FW
As much as I hate to suggest it, this sounds like a good time to use XML. Store each report as XML (in a file, or in a database row), then use templates to render the data. -Jeff On Feb 9, 3:24 pm, Dids wrote: > > This is extremely unlikely to work, not to mention very inefficient. > > Can you

Re: Bizarre sqlite3 / apache2 behaviour

2009-02-10 Thread Jeff FW
You need to make sure that the user apache is running as (usually "apache") has write access to the database file *and* the directory that the database file is in. The development server would work because *you* probably have write access to those paths. As for the sqlite3 version, run python, t

Re: SQLite, swedish signs

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 2:55 PM, DaSa wrote: > > The traceback: > > Environment: > > Request Method: POST > Request URL: http://127.0.0.1:8000/admin/polls/poll/add/ > Django Version: 1.0.2 final > Python Version: 2.5.3 > [snip] > File "C:\Python25\Lib\site-packages\django\utils\encoding.py" in >

Re: SQLite, swedish signs

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 2:55 PM, DaSa wrote: > > The traceback: > > Environment: > > Request Method: POST > Request URL: http://127.0.0.1:8000/admin/polls/poll/add/ > Django Version: 1.0.2 final > Python Version: 2.5.3 > [snip] > File "C:\Python25\Lib\site-packages\django\utils\encoding.py" in >

Re: html italic tag hinders search code

2009-02-10 Thread Jeff FW
Yes, that's what I was suggesting. Sorry for not being more clear. As for storing the field twice, unless you're planning to have huge amounts of records, you wouldn't really noticed any difference at all. Also, you can have the admin interface set to *not* display the stripped version, so your

Re: SQLite, swedish signs

2009-02-10 Thread DaSa
The traceback: Environment: Request Method: POST Request URL: http://127.0.0.1:8000/admin/polls/poll/add/ Django Version: 1.0.2 final Python Version: 2.5.3 Installed Applications: ['django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'djan

Problem posting a form to two separate URLs

2009-02-10 Thread potterrauzon
Hello. I am trying to get a form to post to two separate URLs. I need to save the data to my own database and I am also trying to post the data to a URL for a company that does data tracking with it's own database. I realize that I could use javascript on the form template, or I could run a cro

Re: including non-editable fields in forms?

2009-02-10 Thread Margie
Thanks Malcolm. I think inserting it directly in the form template will work fine for my purposes. Margie On Feb 9, 9:18 pm, Malcolm Tredinnick wrote: > On Mon, 2009-02-09 at 21:14 -0800,Margiewrote: > > I have a model that contains a 'created' field where 'editable' is set > > to False in the

Re: YUI Image Uploader - OK on Firefox/Mac but not elsewhere

2009-02-10 Thread phoebebright
I'm pretty sure I have all the paths correct because the TinyMCE/ Filebrowser works ok on firefox mac, just not on any other browser. The only setting I changed was FILEBROWSER_URL_WWW = '/site_media/ uploads/'. At this stage I am trying to get the upload to happen in PHP as I can get that to wor

Re: YUI Image Uploader - OK on Firefox/Mac but not elsewhere

2009-02-10 Thread esatterwh...@wi.rr.com
I found the TinyMCE & filebrowser insanely easy to impliment. I would say 9 out of the 10 issued I had was simply a matter of defining the right paths. I also found that creating a symlink for the admin media folder and calling it 'media/' solved most of the path name issues. that way you can lea

Re: Filter by ForeignKey reference??

2009-02-10 Thread Markus T.
That's it - thanks a lot!!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to djang

0.96 to 1.0 admin conversion

2009-02-10 Thread homebrew79
I'm in the process of converting a project from 0.96 to 1.0. The newforms admin has me a little stumped. The way I currently have one of my models set up is like so: cpip = models.ForeignKey('Cpip', edit_inline=models.TABULAR, num_in_admin=10, num_extra_on_change=3) That will give me 10 inline

version control convention?

2009-02-10 Thread Serdar T.
Is it better to create repositories at a site-, project- or app-level? In other words, if I implement the conventional[1] directory structure below, is it better to place the entire site (example.com) under a single git repository, or would it be wiser to create separate git repos for each custom

Re: Pretty admin pages

2009-02-10 Thread Ramiro Morales
On Tue, Feb 10, 2009 at 12:38 PM, djandrow wrote: > > I believe its quite akward to create a system link in XP so I tried > copying them to myproject/media file, but it didn't like that either. > > Should they go in the htdocs file or what? > This is more an Apache question, things should be set

Re: m2m field and forms

2009-02-10 Thread Konstantin S
On Feb 10, 5:51 pm, Sergey Koval wrote: > On Tue, Feb 10, 2009 at 1:21 PM, Konstantin S wrote: > > > Hello > > > I have a form created from forms.ModelForm and in my model one of the > > fields is m2m field. Now when form is displayed for that m2m filed I'd > > like to have something that looks

Re: A solution for django/postgresql transaction problem

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 9:58 AM, azer wrote: > > Hi, > I modified django's db/backends/postgresq_psycopg2/base.py and fixed > the problem.I added this lines before "cursor = self.connection.cursor > ()": > ># if transaction is broken, run rollback method >if self.connection.get_transactio

Re: Question about Filtering on a Related model (I think) - with example code.

2009-02-10 Thread Daniel Roseman
On Feb 10, 2:25 pm, Almost George wrote: > On Feb 10, 1:30 am, Daniel Roseman > wrote: > That doesn't seem to work. Here's my manage.py shell session, which > appears as I expected it to: (hopefully email clients/google won't > screw up the quoting, otherwise seehttp://dpaste.com/118932/) > > >

Re: Question about Filtering on a Related model (I think) - with example code.

2009-02-10 Thread Almost George
On Feb 10, 8:25 am, Almost George wrote: > On Feb 10, 1:30 am, Daniel Roseman > wrote: > > > > > On Feb 10, 5:03 am, Almost George > > wrote: > > > > On the following example models (actual models, removed of cruft that > > > doesn't seem to apply) I'd like to add a "get_upcoming_events" meth

A solution for django/postgresql transaction problem

2009-02-10 Thread azer
Hi, I modified django's db/backends/postgresq_psycopg2/base.py and fixed the problem.I added this lines before "cursor = self.connection.cursor ()": # if transaction is broken, run rollback method if self.connection.get_transaction_status()==3: self.connection.rollback() # I hope

Re: Key Erro: 'perms' whenever I try and view a table in Admin

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 9:46 AM, merric wrote: > > Help! Completely stuck with this one. Everytime I try to view any > table in the Admin I get an error. > > I am getting a KEY ERROR with exception value of 'perms': > > Exception Location: C:\Python25\Lib\site-packages\django-trunk\django >

Re: m2m field and forms

2009-02-10 Thread Sergey Koval
On Tue, Feb 10, 2009 at 1:21 PM, Konstantin S wrote: > > Hello > > I have a form created from forms.ModelForm and in my model one of the > fields is m2m field. Now when form is displayed for that m2m filed I'd > like to have something that looks like checkbox where user can select > several alter

Key Erro: 'perms' whenever I try and view a table in Admin

2009-02-10 Thread merric
Help! Completely stuck with this one. Everytime I try to view any table in the Admin I get an error. I am getting a KEY ERROR with exception value of 'perms': Exception Location: C:\Python25\Lib\site-packages\django-trunk\django \template\context.py in __getitem__, line 43 Anybody have any

Re: Pretty admin pages

2009-02-10 Thread djandrow
I believe its quite akward to create a system link in XP so I tried copying them to myproject/media file, but it didn't like that either. Should they go in the htdocs file or what? Thanks, Andrew --~--~-~--~~~---~--~~ You received this message because you are sub

Re: Question about Filtering on a Related model (I think) - with example code.

2009-02-10 Thread Almost George
On Feb 10, 1:30 am, Daniel Roseman wrote: > On Feb 10, 5:03 am, Almost George > wrote: > > > > > On the following example models (actual models, removed of cruft that > > doesn't seem to apply) I'd like to add a "get_upcoming_events" method > > to Band like the one on Venue, but because of the r

Re: Forms, fields and widgets

2009-02-10 Thread Sergey Koval
On Tue, Feb 10, 2009 at 10:14 AM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > Your constraints are a bit arbitrary and, in fact, overly-restrictive. > In particular the "without changing ModelForm" wish is just that: a > hope, not something that falls out of the design as "it looks lik

Re: trouble with template tag

2009-02-10 Thread Daniel Roseman
On Feb 10, 2:07 pm, Bobby Roberts wrote: > Hi.  I have the following template tag: > > @register.filter(name='elementtotext') > @stringfilter > def elementtotext(string): >     itext='Unknown' >     if string=='DR': >         itext='Door' >     if string=='FL': >         itext='Flooring' >     if

trouble with template tag

2009-02-10 Thread Bobby Roberts
Hi. I have the following template tag: @register.filter(name='elementtotext') @stringfilter def elementtotext(string): itext='Unknown' if string=='DR': itext='Door' if string=='FL': itext='Flooring' if string=='FO': itext='Foundation' if string=='FR':

Re: comparisons with java framework

2009-02-10 Thread Alex Gaynor
On Tue, Feb 10, 2009 at 6:41 AM, igorlash wrote: > > > If I have correctly interpreted you correctly, this was an > > extraordinarily long-winded way to ask "Is there anywhere I can > > download a PDF of the Django documentation, and if not, why not?" > > I've not asked "Is there anywhere I can >

Re: comparisons with java framework

2009-02-10 Thread igorlash
> If I have correctly interpreted you correctly, this was an > extraordinarily long-winded way to ask "Is there anywhere I can > download a PDF of the Django documentation, and if not, why not?" I've not asked "Is there anywhere I can download a PDF of the Django documentation, and if not, why no

Re: Deploying Django tutorial part 4, redirecting problem, apache error

2009-02-10 Thread a...@amos-site.org.uk
Where exactly do you put this I'm guessing in the file, but a bit of context would be appreciated. On Jan 19, 7:17 am, Adam Yee wrote: > Success.  I added > > 'script_name': request.META['SCRIPT_NAME'] > > into the context of object_detail() in django's generic views > list_detail.py.  Here's th

Re: Group By and aggregation

2009-02-10 Thread Alessandro
2009/2/10 Russell Keith-Magee > > > i.e., plural modules, not singular module, in the Max lookup. It's the > reverse lookup name for the module relationship on Module_scheme. For > future reference, the message on the FieldError tells you the right > name - modules. You're great. It works. Tha

Re: Group By and aggregation

2009-02-10 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 8:43 PM, Alessandro wrote: > > > 2009/2/10 Russell Keith-Magee >> >> >> However, if you're using Django trunk, what you want is: >> >> >>> from django.db.models import Max >> >>> qs = >> >>> Module_scheme.objects.filter(plant=3).annotate(max_energy_tot=Max('module__energy

Re: Group By and aggregation

2009-02-10 Thread Alessandro
2009/2/10 Russell Keith-Magee > > > However, if you're using Django trunk, what you want is: > > >>> from django.db.models import Max > >>> qs = > Module_scheme.objects.filter(plant=3).annotate(max_energy_tot=Max('module__energy_tot')) > >>> for mod in qs: > ...print mod.id, mod.max_energy_to

Re: Group By and aggregation

2009-02-10 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 6:47 PM, Alessandro Ronchi wrote: > I have to get the max value of a model grouped by a field. > > The RAW SQL query is this: > > SELECT max(energy_tot) FROM fotovoltaico_modules,fotovoltaico_module_scheme > WHERE fotovoltaico_module_scheme.plant_id = 3 AND > fotovoltaico_

m2m field and forms

2009-02-10 Thread Konstantin S
Hello I have a form created from forms.ModelForm and in my model one of the fields is m2m field. Now when form is displayed for that m2m filed I'd like to have something that looks like checkbox where user can select several alternatives. I know that I can use widgets here and there are some that

Re: Pretty admin pages

2009-02-10 Thread Ramiro Morales
On Mon, Feb 9, 2009 at 10:07 PM, djandrow wrote: > > Hello all, > > I have just set up the admin pages for my site and if i use the built > in server i get the admin with the nice templates, but if I display it > on mod_python I just get the plain text, which is pretty hard to work > with. > > I

Re: comparisons with java framework

2009-02-10 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 4:21 PM, igorlash wrote: > > Hi everybody. > I'm java developer , and I like comparing web frameworks. > Members of django community talk a lot about easiness of django > especially comparing with java frameworks. But they have not compared > all aspects. And I want to com

Re: Prepoplulate admin form with previously entered data

2009-02-10 Thread Marco Bazzani
here is how http://docs.djangoproject.com/en/dev/ref/contrib/admin/#save-as On Tue, Feb 10, 2009 at 12:04 PM, Marco Bazzani wrote: > you can open a patient modify it and save it as new > > On Tue, Feb 10, 2009 at 4:00 AM, Adam Woodbeck > wrote: >> >> Would it be possible to extend the ModelFor

Re: Prepoplulate admin form with previously entered data

2009-02-10 Thread Marco Bazzani
you can open a patient modify it and save it as new On Tue, Feb 10, 2009 at 4:00 AM, Adam Woodbeck wrote: > > Would it be possible to extend the ModelForm for my encounter model, > automatically filling the form when I add a new entry? > > On Feb 9, 9:51 pm, Adam Woodbeck wrote: >> I'm building

user env needed in apache with mod_wsgi

2009-02-10 Thread Alan
Hi list, My problem is that: since when using apache + mod_wsgi I got a neutral env for my server (e.g. PATH=/usr/bin:/bin) but in the end what I need is all the envs that is in a particular $HOME/.bashrc file in order to when server spawns a program (that may not be in the neutral PATH and besides

Re: date error

2009-02-10 Thread Hervé Edorh
Hello Mr Alex i think you have forgotten me --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send

Group By and aggregation

2009-02-10 Thread Alessandro Ronchi
I have to get the max value of a model grouped by a field. The RAW SQL query is this: SELECT max(energy_tot) FROM fotovoltaico_modules,fotovoltaico_module_scheme WHERE fotovoltaico_module_scheme.plant_id = 3 AND fotovoltaico_modules.scheme_id = fotovoltaico_module_scheme.id GROUP BY fotovoltaico_

autocomplete searching many to many admin with large amount of data

2009-02-10 Thread christian
I've seen this discussed a few times but have yet to hear/find a suitable solution: I have a ManyToManyField in my admin which was doing great with filter_horizontal until we imported the legacy database and realized we had more than 5000 rows for said field. Needless to say writing the select ta

Re: Subclass conflict with admin widgets

2009-02-10 Thread phoebebright
That makes sense. I'll just create a different admin for each model. Thanks. On Feb 10, 4:36 am, Karen Tracey wrote: > On Mon, Feb 9, 2009 at 5:18 PM, phoebebright wrote: > > > > > > > Yes I see that, it's just if I don't put the custom form in it works > > fine: > > > class DirectoryAdmin(adm

signal connection

2009-02-10 Thread Ben Eliott
Can anyone please suggest why a signal might be failing to connect. I'm using 1.0.2 on apache + mod_wsgi. The signal gets picked up fine using the localserver, but fails on the server proper. When i go into the shell and get the signal object and check 'receivers' i can see the listener reg

Re: Forms, fields and widgets

2009-02-10 Thread Malcolm Tredinnick
On Tue, 2009-02-10 at 09:56 +0200, Sergey Koval wrote: > Hello, > > I read mentioned thread and still can't figure out how I can pass > arbitrary values to widgets. > OK, I'll rephrase question (it was "task" in the previous email): how > I can make widget that takes two values out of the model

Re: Django and jQuery trouble

2009-02-10 Thread Antoni Aloy
2009/2/10 min : > > Hi, everyone. > > I have a question for the following example. > > Firstly, in the view.py: > > def test_1(request, zipcode, pro): > if zipcode == 'a' and pro == 'b': >city = 'c' > else: >city = '' > > return HttpResponse(city) > > def test_0(request): > return rend