Re: Stephane += Aspen 0.7 (Python webserver)

2007-01-20 Thread Vizcayno
Chad: 1) I did some tests with a django project and, my web pages look ugly because the reference to .css files was lost, additionally I can not retrieve the content of static files when a click on a certain link. It seems that Aspen needs a reference to these resources. I had a similar problem

Re: how to list all Tags for Blog? or simple m2m filtering...

2007-01-20 Thread Kai Kuehne
Hi, On 1/21/07, natebeaty <[EMAIL PROTECTED]> wrote: > Wait, can't you just use post.tags.all in your object_detail template > without any wrappers (for all tags related to a post)? Django will > auto-populate such a related list in a generic view: > > {% if post.tags.all %} >

Re: how to list all Tags for Blog? or simple m2m filtering...

2007-01-20 Thread natebeaty
Ivan Sagalaev wrote: > Apart from these two ways of working around views there is also a > 'template context processor' thingy. It's like extra_context but not > static. It's a custom function returning context dict that is called for > every view (well not exactly every view but it doesn't matter

Re: how to list all Tags for Blog? or simple m2m filtering...

2007-01-20 Thread natebeaty
Kai Kuehne wrote: > If you only want to list the tags related to the current blog entry (e.g., on > a object_detail generic view site) I would wrap the generic view instead > of filling the urls.py file with logic. Imho, there should be no logic > in urls.py > > And that is what I'm trying to unde

Re: how to list all Tags for Blog? or simple m2m filtering...

2007-01-20 Thread Ivan Sagalaev
natebeaty wrote: > ..but apparently this will only populate the tags once, when I start up > Django, correct? Do I need to add the extra_context in a wrapper around > a generic view in views.py? Or would something like this be best > implemented as a template_tag? > > Am I correct in assuming it

Re: how to list all Tags for Blog? or simple m2m filtering...

2007-01-20 Thread Kai Kuehne
Hi Nate, On 1/20/07, natebeaty <[EMAIL PROTECTED]> wrote: > blog_dict = { > 'queryset': Blog.objects.all(), > 'template_object_name': 'blog', > "extra_context" : { > "blog_month_list" : Blog.objects.dates("date_added", "month"), > "current_issue" : Issue.objects.latest

Re: having trouble with css file location

2007-01-20 Thread rsie
Thanks for your response! I finally got it working. I was using the dev server and with your link I was able to cobble together some responses there. After playing around a bit I now see what is going on. One of the responses was that maybe /media/ was "special" in some way. I was using that dir

Re: how to list all Tags for Blog? or simple m2m filtering...

2007-01-20 Thread natebeaty
Ivan Sagalaev wrote: > Actually I've forgot 'distinct' yet again: > > Tag.objects.filter(blog__id__isnull=False).distinct() > > ...or there would be dupes in the result. Awesome, thanks so much Ivan. Another quick question, where is the best place to put this? I made the mistake of putting

Re: Generic Views - problem with template missing

2007-01-20 Thread Panos Laganakos
On Jan 20, 9:11 pm, "Guillermo Fernandez Castellanos" <[EMAIL PROTECTED]> wrote: > Maybe you need the allow_empty=True option in your urls.py. Indeed, that did it. Though, I'm curious, as there's already content in the posts table, shouldn't these show up as I've defined them in the template?

FC5/modpython/Django0.96pre

2007-01-20 Thread Rob J Goedman
Hi, A project, developed on OSX, needs to be moved to FC5, headless. ./ manage.py runserver works fine. But behind Apache 2.2/mod_python I get below error. FC5 does use python 2.4.3 (on OSX I use python2.5). Any hint where I should be looking. If I modify settings so it does not find the te

Re: Generic Views - problem with template missing

2007-01-20 Thread Guillermo Fernandez Castellanos
Maybe you need the allow_empty=True option in your urls.py. G On 1/20/07, Panos Laganakos <[EMAIL PROTECTED]> wrote: > > I'm using Django 0.95 release. > > I've got a simple blog, which I wanna move to generic views. > > in settings.py: > TEMPLATE_DIRS = ( > '/home/panos/projects/panos/templ

Re: having trouble with css file location

2007-01-20 Thread Karen
Are you using the development server? If so, have you read and followed the instructions here: http://www.djangoproject.com/documentation/static_files/ ? (I too started out by trying to set MEDIA_ROOT to get Django to serve up my stylesheets, but it won't do it. It seems from various comments

having trouble with css file location

2007-01-20 Thread rsie
I'm having trouble getting my templates to recognize the location of my css files. I've set MEDIA_ROOT to /home/rsie/projects/django_templates which has a directory media/css under it. The following is the stylesheet line in my template: . Problem is it never resolves the location correctly. Am I

having trouble with templates recognizing locations of css files

2007-01-20 Thread rsie
I'm not sure what to do to get my templates to resolve the css file locations. My media files are located at: /home/rsie/projects/django_templates/media/css. I then set MEDIA_ROOT=/home/rsie/projects/django_templates and then defined in my template, but it can't locate the css file. Seems like th

Generic Views - problem with template missing

2007-01-20 Thread Panos Laganakos
I'm using Django 0.95 release. I've got a simple blog, which I wanna move to generic views. in settings.py: TEMPLATE_DIRS = ( '/home/panos/projects/panos/templates', ) in ./blog/urls.py: from django.conf.urls.defaults import * from panos.blog.models import Post info_dict = { 'queryset

Re: Dynamically adding fields to a database model class

2007-01-20 Thread Christian Joergensen
Russell Keith-Magee wrote: > On 1/20/07, Christian Joergensen <[EMAIL PROTECTED]> wrote: >> I suspect there is some django magic happening behind the scenes, and >> maybe the setattr trick is not at all possible. Can anyone shed some >> light on this? > > Yes - the model class has a metaclass that

Re: Generic views and filtering

2007-01-20 Thread Nicolas Steinmetz
natebeaty wrote: > > You can do this without a wrapper -- your url entry was close: > > (r'^tag/(?P[-\w]+)/$','django.views.generic.list_detail.object_detail', > dict(queryset=Tag.objects.all(), template_object_name='tag', > slug_field='url')), > > and you'll get a list in /templates/tags/tag_

Re: Newforms dynamic fields (good to know)

2007-01-20 Thread [EMAIL PROTECTED]
HÃ¥kan Johansson wrote: > While working on a complex form using 'newforms' I had some problem > with 'initial' data. > I have multiple forms using the 'prefix' argument to get different > keys for them. > > As far as I know (*please* correct me if I am wrong) the only way to > set initial data dy

Re: Context-sensitive 'upload_to' parameter for FileField

2007-01-20 Thread Jay Parlar
On 1/19/07, Patrick J. Anderson <[EMAIL PROTECTED]> wrote: > > Hi, I was wondering if it is possible, and if so then how, to have a > context-sensitive 'upload_to' parameter set for FileField. > > Let's say, I have the following model concept: > > class MyModel(models.Model): > folder = mo

Download Weather Toolbar

2007-01-20 Thread rohan$
Download Weather Toolbar - Instant weather reports, forecasts, and radar images anytime for FREE! - http://surl.in/HLWTD238206SVRAKSX --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

catching database error

2007-01-20 Thread [EMAIL PROTECTED]
Hello Django Users, I'm building a application in Django where users have to sign in with user name and password. For instance a user defines a wrong password the Django will return DoesNotExist. How can i catch this specific error. Offcorse i can use try and except but this means i can't diffe

Re: dump and restore tool for django

2007-01-20 Thread limodou
> ./manage.py dumpdb > /foo/bar/out.data I don't like this. Because I want to save the data into different files according to each table, but not a single file. > > And if there is foreignkey relationship in one app, the > > order of output data is very important. Because the restore process > >

Re: dump and restore tool for django

2007-01-20 Thread Russell Keith-Magee
On 1/20/07, limodou <[EMAIL PROTECTED]> wrote: > > On 1/20/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > > > On 1/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > I was looking for something like this :) I'll test it today :) > > > > You should also keep in mind that the fi

Re: dump and restore tool for django

2007-01-20 Thread limodou
On 1/20/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On 1/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > I was looking for something like this :) I'll test it today :) > > You should also keep in mind that the fixtures patch that is part of > ticket #2333 can be used to dump

Re: Dynamically adding fields to a database model class

2007-01-20 Thread Russell Keith-Magee
On 1/20/07, Christian Joergensen <[EMAIL PROTECTED]> wrote: > > I suspect there is some django magic happening behind the scenes, and > maybe the setattr trick is not at all possible. Can anyone shed some > light on this? Yes - the model class has a metaclass that is used to convert the member fi

Re: dump and restore tool for django

2007-01-20 Thread Russell Keith-Magee
On 1/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I was looking for something like this :) I'll test it today :) You should also keep in mind that the fixtures patch that is part of ticket #2333 can be used to dump and reload database contents. This patch should be applied shortly (it