Re: Get request path without having a request object

2010-07-31 Thread James Bennett
On Sat, Jul 31, 2010 at 12:37 PM, cootetom wrote: > Thanks Carlos but I'm trying to achieve getting the path without > having to pass the request object. In a word: don't. Instead, design your system to pass the information you need where and when you need it. This doesn't

ANN: django-forms-builder 0.2.0 released

2010-07-31 Thread Stephen McDonald
Hi Djangonauts, I've released a new version of django-forms-builder. It's a small Django reusable app that allows admin users to build their own forms. This release is a complete rewrite that addresses the fact that previously the fields available for forms created by admin users were restricted

Django error can't adapt

2010-07-31 Thread Daniel França
Hi, I just migrated from Linux to Mac OS, and I'm getting an error message when I try register a new user of my django site, (at my page) I get the error: can't adapt type 'US/Eastern' I'm using Postgresql and psycopg2, I tried to change the TIME_ZONE to 'America/Sao_Paulo'(I'm in Brazil), but the

Unable to add model in admin (but can list them)

2010-07-31 Thread Fell
I've been scratching my head over this for awhile now -- I have an app called "main" that has two models defined "entity" "story" -- I am able to see a list of each via the following urls: http://127.0.0.1:8000/admin/main/entity/ http://127.0.0.1:8000/admin/main/story/ However, I'm only able

django-admin.py not working

2010-07-31 Thread ginost7
Im using ubuntu I managed to get through the poll project working on the django tut. then tried another project At the prompt i get g...@gino-laptop:~/djangoDEV$ django-admin The program 'django-admin' is currently not installed. You can install it by typing: sudo apt-get install

Re: How do I populate a multi-select field with a single column from a model?

2010-07-31 Thread Kalys Osmonov
Area.objects.values('name','city') On Jul 31, 5:07 pm, strayhand wrote: > I want to grab a single column in a model and use it to populate a > multi-select form field. Here's the code that I'm currently using: > > areas =

Re: Which program will run when we execute "djano-admin.py startproject mysite" command?

2010-07-31 Thread Casey S. Greene
It runs django-admin.py using the python interpreter. Maybe this webpage, or a windows user on this list, will have the answer: http://docs.python.org/faq/windows.html Hope this helps, -- Casey On 07/31/2010 03:57 PM, balu wrote: Yah... I tried it by adding python in the command line. But I

Re: Which program will run when we execute "djano-admin.py startproject mysite" command?

2010-07-31 Thread balu
Yah... I tried it by adding python in the command line. But I couldn't get the actual result. Could you people can give a gist of what happens when we type "django-admin.py startproject mysite" i.e., which program will run when we type that and press return key. On Aug 1, 12:41 am, "Casey S.

Re: Which program will run when we execute "djano-admin.py startproject mysite" command?

2010-07-31 Thread Casey S. Greene
Hi, I'm not a windows user but I'm guessing that you want to use the python executable (see if you can find something called "python". Alternatively, what if you run it with: python django-admin.py startproject mysite Hope this helps, -- Casey On 07/31/2010 03:12 PM, balu wrote: Hi

Which program will run when we execute "djano-admin.py startproject mysite" command?

2010-07-31 Thread balu
Hi everybody I installed python and django in my Windows 7 home premium operating system. But when I tried to execute "django-admin.py startproject mysite" command in it, the Operating system is asking me to choose the program to run this application. But this is not happened when I tried this in

Re: Get request path without having a request object

2010-07-31 Thread cootetom
Thanks Carlos but I'm trying to achieve getting the path without having to pass the request object. On Jul 31, 7:11 pm, Carlos Daniel Ruvalcaba Valenzuela wrote: > Just add django.core.context_processors.request to your > TEMPLATE_CONTEXT_PROCESSORS, this way you can access

Re: how to get parent of related m2m model instance from within a template?

2010-07-31 Thread esatterwh...@wi.rr.com
http://docs.djangoproject.com/en/dev/topics/db/queries/#related-objects On Jul 30, 12:29 pm, J wrote: > I have a model, which has a related model, which then has a related > m2m field (See defs below). > > I want to add a method to the m2m model (ie: "Button") which, when >

Re: Get request path without having a request object

2010-07-31 Thread Carlos Daniel Ruvalcaba Valenzuela
Just add django.core.context_processors.request to your TEMPLATE_CONTEXT_PROCESSORS, this way you can access the current request object in your template, you will have to use however RequestContext class with render_to_response, >From docs: django.core.context_processors.request If

Re: Get request path without having a request object

2010-07-31 Thread cootetom
I think perhaps I'll also put this problem another way. I need to cache data against the current web request without having the Django built request object. On Jul 31, 4:56 pm, cootetom wrote: > Hi all, > > Is there any way of getting the request.path value without having

Re: How do I populate a multi-select field with a single column from a model?

2010-07-31 Thread strayhand
Sweet. That did the trick. I found an example here: http://www.djangoproject.com/documentation/models/str/ # Areas Model UPDATED from django.db import models # Create your models here. class Area(models.Model): name = models.CharField(max_length=40) city =

Re: How do I populate a multi-select field with a single column from a model?

2010-07-31 Thread strayhand
Ah... Well that's exactly what's happening. I'm getting "Area Object" for each element in the select box. I've seen the __unicode__ method on a few model examples, but my book and other resources never really showed or explained it. I'll see if I can find some explanation of it. Thanks for the

Get request path without having a request object

2010-07-31 Thread cootetom
Hi all, Is there any way of getting the request.path value without having the request object that Django pass's around. Is there something similar to os.environ for the web request where I can get the path? I'm developing an app that needs to cache data on a page basis but the data may come from

Re: moving to django 1.2.1

2010-07-31 Thread Russell Keith-Magee
On Sat, Jul 31, 2010 at 9:45 PM, Michael P. Soulier wrote: > On 30/07/10 tiemonster said: > >> I cover some of the new changes in Django 1.2 in this article: >> http://www.tiemonster.info/a/24005/ >> >> Most of this information comes straight from the changelist. Others

Re: moving to django 1.2.1

2010-07-31 Thread Russell Keith-Magee
On Fri, Jul 30, 2010 at 8:14 PM, tiemonster wrote: > I cover some of the new changes in Django 1.2 in this article: > http://www.tiemonster.info/a/24005/ > > Most of this information comes straight from the changelist. Others > were things that the core developers must have

Re: moving to django 1.2.1

2010-07-31 Thread Michael P. Soulier
On 30/07/10 tiemonster said: > I cover some of the new changes in Django 1.2 in this article: > http://www.tiemonster.info/a/24005/ > > Most of this information comes straight from the changelist. Others > were things that the core developers must have assumed were common > sense, but that I

Form label suffix

2010-07-31 Thread Martin Tiršel
Hello, If i do following, it works: form = ContactForm(label_suffix=":") print form Your name:... but here it is missing ':': form['name'].label_tag() u'Your name' I need to customize form output, so I can not use print form or as_p(), etc. and I am using following: {% for field in

Re: How do I populate a multi-select field with a single column from a model?

2010-07-31 Thread Daniel Roseman
On Jul 31, 10:07 am, strayhand wrote: > I want to grab a single column in a model and use it to populate a > multi-select form field. Here's the code that I'm currently using: > > areas = forms.ModelMultipleChoiceField(queryset=Area.objects.all(), > label='Preferred Areas',

Getting http://http://domain.com/sitemaps.xml on production server using django sitemaps

2010-07-31 Thread Jonathan Nelson
I'm trying to get sitemaps configured properly for http://newsley.com, but I'm having weird issues with the URLs that are being created for the sitemaps.xml on my production server. e.g. http://newsley.com/sitemap.xml When I run the code on my development server, using ./manage.py runserver,

How do I populate a multi-select field with a single column from a model?

2010-07-31 Thread strayhand
I want to grab a single column in a model and use it to populate a multi-select form field. Here's the code that I'm currently using: areas = forms.ModelMultipleChoiceField(queryset=Area.objects.all(), label='Preferred Areas', help_text='Select the areas that you\'d like to serve.') This code

Re: UnicodeEncodeError

2010-07-31 Thread Daniel Roseman
On Jul 30, 11:17 pm, EricBrian wrote: > Daniel, if I don't do that, I get the unicode error in the list of > dashboards in the admin section. > You'd better post the traceback for that, then. Just to be clear, your method should look like this: def __unicode__(self):