Re: Newbie Django Mac OS X suggestions.

2010-01-31 Thread Nick Lo
> Disagree almost completely. I'm happily developing Django using the > Apple supplied Python and tools, although I have complemented them > with virtualenv and pip. > > The only sore spot in my development stack is that I can't get > psycopg2 to work (due to issues with 32/64-bit in SL), but I si

Re: Select *Latest* Grade Information for every Student

2010-01-31 Thread Tomasz Zieliński
On 29 Sty, 03:16, marsanyi wrote: > The joy of annotate().  In Django 1.1 and above: > > result = Student.objects.annotate(latest = models.Max('grades__date')) > > gives you the recordset, sans test_name.  Any advances on this? > I would suggest: students = Student.objects.annotate(latest_grad

Re: Using a template variable in the "include" template tag

2010-01-31 Thread Sam Lai
If you look carefully, you'll notice I used the ifequal tag (which has existed for ages), instead of the if tag. You're right though; in the dev version, you can just use the if tag with the == operator in between. 2010/1/31 shofty : > i wasn't very clear. i was referring to the inability to use

Re: A Couple Newbie Questions

2010-01-31 Thread Sector7B
thanks, sys.path.append('/path/to') is what i have, and the polls url worked. On Jan 31, 12:27 am, Dave Murphy wrote: > On 30 January 2010 19:59, Sector7B wrote: > > > 1. Reading the documentation for deploying using mod_wsgi.  It says > > not to use just 'settings' in django.wsgi The example

Forms - Selecting foreign keys from large number of options

2010-01-31 Thread Astley Le Jasper
Is there any 'best practice' or established patterns for dealing with forms that capture foreign keys from a very large set of options? - I am building a web app that allows our field staff to create appointments. This involves creating a record that contains many foreign keys, of whi

Django Admin Site "TemplateDoesNotExist" Error.

2010-01-31 Thread Gramware
I get the following output on running http://localhost:8000/admin/ TemplateDoesNotExist at /admin/ admin/login.html Request Method: GET Request URL:http://localhost:8000/admin/ Exception Type: TemplateDoesNotExist Exception Value: admin/login.html Exception Location: /usr/lib/python2.6/sit

Re: Using a template variable in the "include" template tag

2010-01-31 Thread shofty
> You're right though; in the dev version, you can just use the if tag > with the == operator in between. > apparantly so, but i can't get it working. Matt -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Custom form rendering

2010-01-31 Thread jul
hi, I've got the Category model and SearchForm form shown below. I'd like to customize the way the Category field is rendered in my form in order to: -separate in the form the Category instances having a given type to be able to apply a specific style to them in my CSS -show the hierarchy of my ca

Re: customize form in template according to field attribute

2010-01-31 Thread jul
I reposted this question with more details. On Jan 29, 12:56 pm, jul wrote: > hi, > > I've got the Category model and SearchForm form shown below. In my > template I'd like to get all Category instances having a given type to > be able to separate those having different style in my CSS. > How can

Re: Newbie Django Mac OS X suggestions.

2010-01-31 Thread Graham Dumpleton
On Jan 31, 6:40 pm, Thomas Schreiber wrote: > I am extremely satisfied with Homebrew for OSX packet > management:http://github.com/mxcl/homebrew > > Much cleaner to customize and get right than macports, fink, or manual > building. New recipes get added all the time, and most everything I've >

Re: Django Admin Site "TemplateDoesNotExist" Error.

2010-01-31 Thread Gramware
Ok, solved this by including 'django.contrib.admin', in INSTALLED APPS in settings.py -- 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 group, send emai

Re: Generic templates

2010-01-31 Thread esatterwh...@wi.rr.com
if if you want to change the menu based on the user, you could probably just use the user permissions from the auth context processor if the user has the permissions ( access ) to the option - show it else - don't show it. or if you want to use the model you have listed here, you could use the

Re: Newbie Django Mac OS X suggestions.

2010-01-31 Thread dk
I agree with Dave. Since we're on the anecdote topic, I'll explain with my own. Ignoring a bit of time with VMS, I have been a *nix user since the 1980s. My path has been from BSD to solaris to linux to osx. A pleasure in moving from solaris to linux, was the tools for bulding/ install software

Custom admin widget for custom type

2010-01-31 Thread Christophe Pettus
Hi, I've implemented a custom Python class and Django field class for Jeff Davis' custom PERIOD type for PostgreSQL: http://temporal.projects.postgresql.org/ Now, I'd like to show it in the admin as two datetimes (with pickers) rather than as the text representation of it. What's

TemplateSyntaxError at /admin/ - 'module' object has no attribute 'rindex'

2010-01-31 Thread zweb
after login to admin, now I get this error, any clues on what to look for? using django 1.1.1 Ashish TemplateSyntaxError at /admin/ Caught an exception while rendering: 'module' object has no attribute 'rindex' Original Traceback (most recent call last): File "/Library/Python/2.5/site-packa

Re: TemplateSyntaxError at /admin/ - 'module' object has no attribute 'rindex'

2010-01-31 Thread Martin J. Laubach
> Caught an exception while rendering: 'module' object has no attribute > 'rindex' Sounds you are using foo.bar instead of 'foo.bar' somewhere (ie. module instead of string). mjl -- You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Re: TemplateSyntaxError at /admin/ - 'module' object has no attribute 'rindex'

2010-01-31 Thread zweb
In my urls.py I see only two possible places where I do not have quotes, 1.(r'^admin/', include(admin.site.urls)), I tried putting include('admin.site.urls')) but it could not find 'admin.site.urls' 2. (r'^register/$', register,{'opensource':True}), True is not in quotes. But it is workin

Dynamic URL for representatives DB

2010-01-31 Thread Nick
Thanks in advance for anyone answering this thread. I am building a DB of local government representatives. My goal is to spit out a general list of the reps and a detailed bio page for each rep. The URL structure I would like to have is 'government/reps/list' for a list of all of the Reps and 'g

Visual appearance (i.e. templates) for admin site

2010-01-31 Thread Joakim Hove
Hello, I am starting to get up to "speed" with Django - and I really like it! Now I have a question about the visual appearance of the admin site. When I first tried the admin site a couple of months ago it looked "very nice"; since then the code has been rewritten from scratch and I don't have a

Re: TemplateSyntaxError at /admin/ - 'module' object has no attribute 'rindex'

2010-01-31 Thread Martin J. Laubach
> 1.    (r'^admin/', include(admin.site.urls)), That looks like it. > I tried putting include('admin.site.urls')) but it could not find > 'admin.site.urls' Do you have 'django.contrib.admin' in INSTALLED_APPS? mjl -- You received this message because you are subscribed to the Goog

Re: Dynamic URL for representatives DB

2010-01-31 Thread Daniel Roseman
On Jan 31, 7:29 pm, Nick wrote: > Thanks in advance for anyone answering this thread. > > I am building a DB of local government representatives. My goal is to > spit out a general list of the reps and a detailed bio page for each > rep. > > The URL structure I would like to have is 'government/re

Re: Visual appearance (i.e. templates) for admin site

2010-01-31 Thread Daniel Roseman
On Jan 31, 7:32 pm, Joakim Hove wrote: > Hello, > > I am starting to get up to "speed" with Django - and I really like it! > Now I have a  question about the visual appearance of the admin site. > When I first tried the admin site a couple of months ago it looked > "very nice"; since then the code

Re: Visual appearance (i.e. templates) for admin site

2010-01-31 Thread Joakim Hove
Thank you - that seems like a very reasonable explanation. When things worked previously I was using the built in dev-server, whereas I am now using Apache + WSGI. On Jan 31, 9:07 pm, Daniel Roseman wrote: > On Jan 31, 7:32 pm, Joakim Hove wrote: > > > > > Hello, > > > I am starting to get u

Re: Dynamic URL for representatives DB

2010-01-31 Thread Nick
Daniel, Thanks for the quick reply. I have made the adjustments to the URLS and the views and am getting a 404 error Not Found The requested URL /Government/reps/Prater_David was not found on this server. (using the entry for David Prater) I'm not really sure why it isn't picking up the URL.

Re: TemplateSyntaxError at /admin/ - 'module' object has no attribute 'rindex'

2010-01-31 Thread Karen Tracey
On Sun, Jan 31, 2010 at 2:39 PM, Martin J. Laubach > wrote: > > 1.(r'^admin/', include(admin.site.urls)), > > That looks like it. > No, that is the correct way to specify admin urls for 1.1 and up. No quotes around admin.site.urls. One way the reported error can happen is when what is in

Cannot authenticate ...

2010-01-31 Thread tsmets
I create in my model the Authors class Author(User): """ An Author is someone more of less identified """ # TODO : Ensure that in fact the users are FK to the Django user management code gender = models.CharField(max_length=1, choices=GENDER_CHOICES) persistance = models.ForeignKey(Persis

Re: Cannot authenticate ...

2010-01-31 Thread tsmets
Forgot to add my source : _ models.py _ Testdata.py *** from django.db import models import logging from django.contrib.auth.models import User, UserManager log = logging.getLogger('dpaste.models') GENDER_

Re: Dynamic URL for representatives DB

2010-01-31 Thread Nick
Just checked again and I'm getting the output I was looking for. Thanks for the help. I guess the server was just taking a little time to pick up changes to the URL confs. On Jan 31, 5:58 pm, Nick wrote: > Daniel, > > Thanks for the quick reply.  I have made the adjustments to the URLS > and th

Re: Dynamic URL for representatives DB

2010-01-31 Thread Nick
I'm definitely going to continue looking into this. But if you have any advice on how I can store the rest of the fields from the DB to call up on the individual reps pages I would greatly appreciate it. Right now I am only pulling in the last name and first name and need to return all of the objec

Re: Generic templates

2010-01-31 Thread Dylan Evans
On Sun, Jan 31, 2010 at 11:46 PM, esatterwh...@wi.rr.com < esatterwh...@wi.rr.com> wrote: > if if you want to change the menu based on the user, you could > probably just use the user permissions from the auth context processor > > if the user has the permissions ( access ) to the option - show it

how to work with css

2010-01-31 Thread chiranjeevi.muttoju
Hi, I want to import the external style sheets in the template page. i imported directly like ordinary HTML pages but its not working here. if any body knows how to import the css in template page please help me. i'm integrating my app in facebook. Thanks and Regards, --chiru -- You received

Re: how to work with css

2010-01-31 Thread andreas schmid
stylesheets are importet like ordinary html pages. you should provide more details like a code snippet and explain if you are experiencing these problems on development or production. chiranjeevi.muttoju wrote: > Hi, >I want to import the external style sheets in the template page. i > importe

Re: Cannot authenticate ...

2010-01-31 Thread Dylan Evans
I think your password is stored in plaintext. try using User.set_password http://docs.djangoproject.com/en/dev/topics/auth/#passwords On Mon, Feb 1, 2010 at 10:42 AM, tsmets wrote: > I create in my model the Authors > > > class Author(User): > """ An Author is someone more of less identified "

Re: how to work with css

2010-01-31 Thread chiranjeevi muttoju
Hi andreas, Thanks for ur reply, i'm getting this problem while developing. where sud i kept my css files, and how should i reference those css files from the template page. i mean how to give specify the address of that css file. for example my css file common.css is in the location project/media/

Re: how to work with css

2010-01-31 Thread andreas schmid
you have to serve these media files as static files. take a look here: http://docs.djangoproject.com/en/dev/howto/static-files/ chiranjeevi muttoju wrote: > Hi andreas, > Thanks for ur reply, i'm getting this problem while developing. where > sud i kept my css files, and how should i reference tho