Re: The view didn't return an HttpResponse object.

2008-12-16 Thread Malcolm Tredinnick
On Tue, 2008-12-16 at 23:23 -0800, oops wrote: > def OrderPlacedView(request): > form = OrderPlaceForm() > try: > print "try" > print request.POST > #brand = BrandName.objects.get(pk=request.POST['brand']) > except: > print"nothing" > return

Re: The view didn't return an HttpResponse object.

2008-12-16 Thread Eric Abrahamsen
On Dec 17, 2008, at 3:23 PM, oops wrote: > > def OrderPlacedView(request): >form = OrderPlaceForm() >try: >print "try" >print request.POST >#brand = BrandName.objects.get(pk=request.POST['brand']) >except: >print"nothing" >return

The view didn't return an HttpResponse object.

2008-12-16 Thread oops
def OrderPlacedView(request): form = OrderPlaceForm() try: print "try" print request.POST #brand = BrandName.objects.get(pk=request.POST['brand']) except: print"nothing" return render_to_response('inventory/orderprocess.html', {'form':form})

Re: Named URLs for Flatpages?

2008-12-16 Thread Nick Sandford
On Wed, Oct 22, 2008 at 6:14 AM, erikcw wrote: > > Hi all, > > I'm working on a project that uses flatpages pretty heavily. I was > wondering if there was a way to use named urls with flatpages so that > I can use reverse() in my other views and {% url

Re: Basic question - using variables in object.filter clauses for DB API

2008-12-16 Thread Malcolm Tredinnick
On Tue, 2008-12-16 at 21:35 -0800, steverfran...@gmail.com wrote: > Given I have a variable that's constructed to contain the filter > clause I want, how do I pass it to the object.filter? > > i.e. > TripFilter="priceseason__end__gte=datetime.now()" > > yet

Basic question - using variables in object.filter clauses for DB API

2008-12-16 Thread steverfran...@gmail.com
Given I have a variable that's constructed to contain the filter clause I want, how do I pass it to the object.filter? i.e. TripFilter="priceseason__end__gte=datetime.now()" yet DiveTrip.objects.filter('TripFilter') results in ValueError at /dive/results too many values to unpack Yet

Re: Is there GUID available in Django or Python?

2008-12-16 Thread Malcolm Tredinnick
On Tue, 2008-12-16 at 20:15 -0800, Chuck22 wrote: > 1. I want to create Global Unique ID (GUID) as the primary key of my > database table. Is there GUID available in Django or Python? The uuid module is part of Python's standard library. Lots of options there for generating various forms of

Is there GUID available in Django or Python?

2008-12-16 Thread Chuck22
1. I want to create Global Unique ID (GUID) as the primary key of my database table. Is there GUID available in Django or Python? 2. Also, I need to create a Authorization Code (random char/number string) to verify user's email when people sign up on my site. Is there generic method in Django or

Re: flatpage error

2008-12-16 Thread prem1er
Rebooted my server and started working for no reason. Don't know what was going on. On Dec 16, 8:25 pm, Malcolm Tredinnick wrote: > On Tue, 2008-12-16 at 13:22 -0800, prem1er wrote: > > Just walked through this > >

Re: login problem

2008-12-16 Thread vierda
Hi Matius, Thank you for your clue, I have modified my code and it run exactly like I want. My code as following below: def my_view(request): username = [] password = [] if request.method == "POST" : username = request.POST['username'] password = request.POST['password']

Re: order by field length?

2008-12-16 Thread David Lindquist
Perfect. Exactly what I needed. Thank you Russ On Dec 16, 5:22 pm, "Russell Keith-Magee" wrote: > On Wed, Dec 17, 2008 at 9:04 AM, David Lindquist > > wrote: > > > I encountered a scenario where I need to query the database for a > > list of

Re: logout_then_login - how to alter login_url

2008-12-16 Thread Malcolm Tredinnick
On Mon, 2008-12-15 at 23:54 -0800, redbaron wrote: > > > However, if you want to pass some extra information to the > > logout_then_login function, look at the third argument in the url() call > > -- the dictionary of extra parameters. You can set up the login_url > > parameter there. > >

Re: flatpage error

2008-12-16 Thread Malcolm Tredinnick
On Tue, 2008-12-16 at 13:22 -0800, prem1er wrote: > Just walked through this guide > http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/?from=olddocs > to get a flatpage working on my site. After trying to access my admin > page I am now getting an error while trying to log in. > > In

Re: django and favicon.ico problem

2008-12-16 Thread Malcolm Tredinnick
On Tue, 2008-12-16 at 02:45 -0800, architecture wrote: > i was working with php and always i put the favicon.ico in the root of > the website but now the problem with django occurs > now i'm working with django and i have a problem now > i used > 1. static.serve > 2. .htaccess > 3.redirect_to >

Re: order by field length?

2008-12-16 Thread Russell Keith-Magee
On Wed, Dec 17, 2008 at 9:04 AM, David Lindquist wrote: > > I encountered a scenario where I need to query the database for a > list of names sorted by length. In SQL this is easy: > > SELECT name from distributors_distributor ORDER BY LENGTH(name) > > Instead of

order by field length?

2008-12-16 Thread David Lindquist
I encountered a scenario where I need to query the database for a list of names sorted by length. In SQL this is easy: SELECT name from distributors_distributor ORDER BY LENGTH(name) Instead of writing raw SQL in my view, I am doing this: names = [x['name'] for x in

Re: Is this a bug in FormWizard?

2008-12-16 Thread Rajesh Dhawan
On Dec 16, 2:31 am, 朱穆穆 wrote: > The extra_context in FormWizard is a class attribute so the new > request may get the context of the previous request. > I can prepend below to __call__ method to solved it: > > self.extra_context = self.extra_context.copy() > > Is this

Re: Problems with Unicode in "verbose_name" and "verbose_name_plural"

2008-12-16 Thread diogobaeder
Thanks a lot, Karen! That solved the problem! :-) And sorry for my lack of attention at the PEP... Bye, Diogo On 16 dez, 21:22, "Karen Tracey" wrote: > On Tue, Dec 16, 2008 at 6:06 PM, diogobaeder wrote: > > > Hi there, > > > I'm trying to use

Re: Problems with Unicode in "verbose_name" and "verbose_name_plural"

2008-12-16 Thread Karen Tracey
On Tue, Dec 16, 2008 at 6:06 PM, diogobaeder wrote: > > Hi there, > > I'm trying to use accents in a string, inside the Meta properties, but > Python throws the following error: > > SyntaxError: Non-ASCII character '\xc3' in file /home/diogo/sites/ >

Problems with Unicode in "verbose_name" and "verbose_name_plural"

2008-12-16 Thread diogobaeder
Hi there, I'm trying to use accents in a string, inside the Meta properties, but Python throws the following error: SyntaxError: Non-ASCII character '\xc3' in file /home/diogo/sites/ projetos/diogobaeder/django_site/diogobaeder/../diogobaeder/developer/ models.py on line 27, but no encoding

Re: fixed data set handling

2008-12-16 Thread adrian
It took over an hour for this to appear, that's why there are 2 threads. On Dec 16, 3:00 pm, adrian wrote: > Hi all, > > I'm writing an app that needs random access to a fixed set of data > (about 1 MB) on just about every request.  (It also uses MySQL for > dynamic data).  

TimeSpan, Latitude, Longitude field classes for Models

2008-12-16 Thread adrian
Has anyone written these? TimeSpan for example, is useful because '2 hours' is not a time, it's a difference between two times. It has its own validation and display needs. I need Lat and Long as well. Thanks --~--~-~--~~~---~--~~ You received this message

Writing custom model fields with Multi-table inheritance

2008-12-16 Thread gordyt
Howdy Folks! I wanted to be able to have UUID primary keys for certain models. I found the implementation done by the django_extensions project (http://code.google.com/p/django-command-extensions/) and it works fine as is. But I wanted to be able to have a UUIDField that stored its values in an

accessing fixed data as Model

2008-12-16 Thread adrian
How could I have some fixed data that is in a Python variable treated as a Model? My app has about 1 MB of data that I need random access to for almost every request. I don't want to read it out of MySQL because it would be slow. I want to put it in a variable declaration in a python

fixed data set handling

2008-12-16 Thread adrian
Hi all, I'm writing an app that needs random access to a fixed set of data (about 1 MB) on just about every request. (It also uses MySQL for dynamic data). I wrote a different app on app-engine that had this requirement as well and I ended up putting the fixed database in a large Python

Re: I love both Django and the Google Web Toolkit. Who else thinks tighter integration would be nice?

2008-12-16 Thread adambossy
Thank you! I'll look into it. I would have never found this on my own. On Dec 16, 11:31 am, "Ian Lawrence" wrote: > Hi > look athttp://autotest.kernel.org/ > this is a djand and gwt application used for kernel testing. It basically > sets up an RPC django server

Re: filter_horizontal

2008-12-16 Thread Rajesh Dhawan
> I'd like to know everything there is to know about using the > filter_horizontal method when displaying admin backend choices. > > I want to re-engineer it. > > I was wondering if anyone has done anything like this and could give me a > couple of pointers to get started. > > Any assistance as

flatpage error

2008-12-16 Thread prem1er
Just walked through this guide http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/?from=olddocs to get a flatpage working on my site. After trying to access my admin page I am now getting an error while trying to log in. In template /home/dev/djprojects/afterthebeep/djTemplates/admin/

Re: Accessing Multiple Databases.

2008-12-16 Thread Tom Eastman
Malcolm Tredinnick wrote: > In hindsight, I probably wasn't clear as to why I'm suggesting this: > there are a lot of places where Django would like to write to your > database (sessions, auth lookups, ...). You can configure around and > away from each of those in turn, but, if this were me,

Re: I love both Django and the Google Web Toolkit. Who else thinks tighter integration would be nice?

2008-12-16 Thread Ian Lawrence
Hi look at http://autotest.kernel.org/ this is a djand and gwt application used for kernel testing. It basically sets up an RPC django server which passes json into gwt. It is a great app to learn how this all works Ian -- http://ianlawrence.info

Re: Model Inheritance with external apps

2008-12-16 Thread bruno desthuilliers
On 16 déc, 19:07, Lyubomir Petrov wrote: > I'm just starting a project that is using django-profile. There are > some fields like "country" that i want to remove. > As in django-profiles I use my own class that extends the base class > (BaseProfile), so i can add some

Re: Media classes in admin.py are only used on add/change page?

2008-12-16 Thread 3lancer.eu
Hi, > Media classes are part of the form framework. The changelist page is > not a form, so it doesn't get the media class. I don't think this is > likely to change. Ahaaa... Okay, thanks! > In any case, I'd say that the media requirements for forms are > different from changelists anyway. As

I love both Django and the Google Web Toolkit. Who else thinks tighter integration would be nice?

2008-12-16 Thread adambossy
I am a staunch advocate of the unconventional Google Web Toolkit (GWT) as a framework for dynamic Web application development. I also use Django, of course. In my current project, much of my time has been wasted devising how to transfer content to and from Django and GWT. The root of my problem

Re: Media classes in admin.py are only used on add/change page?

2008-12-16 Thread Daniel Roseman
On Dec 16, 6:48 pm, "3lancer.eu" wrote: > Hi, > > As I read > onhttp://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-me..., > the files defined in Media classes' js and css attributes will only be > added to html on the add/change page. So as far as I

Media classes in admin.py are only used on add/change page?

2008-12-16 Thread 3lancer.eu
Hi, As I read on http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-media-definitions, the files defined in Media classes' js and css attributes will only be added to html on the add/change page. So as far as I understand, it's only possible to add some js to the change list

Re: Multilanguage flat pages

2008-12-16 Thread 3lancer.eu
Hi, Check out: http://code.google.com/p/django-multilingual/wiki/Introduction They work for me. After installing as mentioned on that page, you still need to have 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware' in your MIDDLEWARE_CLASSES (at least this is how it works in my

django i18n for google

2008-12-16 Thread Alessandro Ronchi
When google spiders our i18n translated django websites, does it try and indicize all languages? is it possible to force the language by a GET var (for example _code=en) ? -- Alessandro Ronchi Skype: aronchi http://www.alessandroronchi.net SOASI Soc.Coop. - www.soasi.com Sviluppo Software e

Model Inheritance with external apps

2008-12-16 Thread Lyubomir Petrov
I'm just starting a project that is using django-profile. There are some fields like "country" that i want to remove. As in django-profiles I use my own class that extends the base class (BaseProfile), so i can add some common information fields. What is the best way that i can remove those field

Re: login problem

2008-12-16 Thread brandonh
I just use the get method on the POST object. username = request.POST.get('username','') if there is no username posted, the username will be blank and should not authenticate. same for the password. On Dec 16, 9:39 am, Matias wrote: > Hello, > > You should show the

Coda plugin

2008-12-16 Thread bax...@gretschpages.com
Have I lost my mind, or did I see a django coda plugin recently? Can't seem to find it now --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

ANN: Softwarefabrica Django Wiki (PRE-RELEASE)

2008-12-16 Thread Marco Pantaleoni
Softwarefabrica Django Wiki (sfwiki) is a free, Open Source, Django wiki application. It is meant to be used as a component in developing full-fledged wiki applications, but it also provides a fully working stand-alone application. Source is available on Launchpad:

Re: middleware import errors [solved]

2008-12-16 Thread Vladimir Kirillov
I've tested flup several times, but it wasn't it. Looks like the problem was really caused by right, but not valid path (which containes relative paths and django path was there three times accidentally), that caused recursive imports, afaik. the problem is solved, thanks On Dec 14, 2:48 am,

Multilanguage flat pages

2008-12-16 Thread nsash
Hi everyone, I activated the flat pages in my django app, but I also need to have them in several languages. Does anyone know how can I achieve this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Anyone maintaining a Svn repo for django-registration?

2008-12-16 Thread Dave Dash
I just hg pull the code from time to time. I've had bad luck running the latest/greatest of anything. So now I only upgrade when I need to. -d On Dec 16, 6:23 am, shabda wrote: > Django registration has moved from googlecode to Bitbucket, which > means my projects

Re: ModelForms customization conundrum

2008-12-16 Thread James Bennett
On Tue, Dec 16, 2008 at 7:19 AM, sagi s wrote: > So I'm looking at the data available in the template to try to get my > hands dirty and restore all this manually but can't find how all this > magic works. I'm in the debugger looking at the form passed to the > template via the

Re: Anyone maintaining a Svn repo for django-registration?

2008-12-16 Thread James Bennett
On Tue, Dec 16, 2008 at 8:23 AM, shabda wrote: > Django registration has moved from googlecode to Bitbucket, which > means my projects which are svn:externaled to django-registration > might not get the latest code. Is anyone maintaining an svn repository > which is I can

Re: Problem with field validation in 1.02

2008-12-16 Thread James Bennett
On Tue, Dec 16, 2008 at 7:44 AM, rtmie wrote: > OK, got it working: > changed view code to: > if request.method =='POST': >form = AppUserForm(request.POST,request.FILES) This is covered in the forms documentation; you may want to give it a read to learn how the

Re: login problem

2008-12-16 Thread Matias
Hello, You should show the login if the method != "POST". By calling render_to_response(...) it will render your template, so that is what the view must return. I think you want something like this: def my_view(request): if request.method == "POST" : username = request.POST['username']

Re: login problem

2008-12-16 Thread Matias
Hello, You should show the login if the method != "POST". By calling render_to_response(...) it will render your template, so that is what the view must return. I think you want something like this: def my_view(request): if request.method == "POST" : username = request.POST['username']

Anyone maintaining a Svn repo for django-registration?

2008-12-16 Thread shabda
Django registration has moved from googlecode to Bitbucket, which means my projects which are svn:externaled to django-registration might not get the latest code. Is anyone maintaining an svn repository which is I can svn:external to? --~--~-~--~~~---~--~~ You

Re: Problem with field validation in 1.02

2008-12-16 Thread rtmie
OK, got it working: changed view code to: if request.method =='POST': form = AppUserForm(request.POST,request.FILES) On Dec 15, 2:48 pm, rtmie wrote: > H i , > I am trying to migrate a project from 0.95 to 1.02 and so have to > migrate all of my old model based

ModelForms customization conundrum

2008-12-16 Thread sagi s
Maybe I'm missing something here but I've been struggling with some basic forms customization issues. I'm using ver. 1.0 I have created a simple model (Metric) and a form to go with it, deriving from django.forms.ModelForm with the model set it the Meta as per the examples. Out-of-the-box the

Re: RHEL 5.2 + mysql + Django 1.0 => Django 0.95.4

2008-12-16 Thread Srdjan Popovic
I had the same situation as my server is CentOS 5.2. Django needed MySQL-python 1.2.2. I tried Yum but the default repo gave me version 1.2.1. You can find version 1.2.2 at SourceForge, but to install it you need to have MySQL development tools installed on your server. The package is called

Re: django and favicon.ico problem

2008-12-16 Thread Graham Dumpleton
On Dec 16, 9:45 pm, architecture wrote: > i was working with php and always i put the favicon.ico in the root of > the website but now the problem with django occurs > now i'm working with django and i have a problem now > i used > 1. static.serve > 2. .htaccess >

django and favicon.ico problem

2008-12-16 Thread architecture
i was working with php and always i put the favicon.ico in the root of the website but now the problem with django occurs now i'm working with django and i have a problem now i used 1. static.serve 2. .htaccess 3.redirect_to but none of them works have you any idea for using favicon.ico in the

Re: Sort Table Headers after data has been rendered via a POST request

2008-12-16 Thread bruno desthuilliers
On 16 déc, 01:15, SnappyDjangoUser wrote: > I wanted to run this by the group one more time does anyone know > how to handle sorting results by table header URL after a POST > request? > > I have used the SortHeaders class for GET requests and it works > great. I am

Re: List a model fields

2008-12-16 Thread bruno desthuilliers
On 16 déc, 10:26, JF Simon wrote: > thanks dude. > > any idea to split the dict on the _ char ? > recursive function ? Probably not the most elegant solution, but it should do the trick: def add_to_context(self, context, field): current = context parts =

Re: Django + mail server

2008-12-16 Thread Aldo
Have a look at this also! http://docs.djangoproject.com/en/dev/topics/email/ On Dec 15, 8:48 pm, Oliver Beattie wrote: > http://docs.djangoproject.com/en/dev/ref/settings/#email-host > > On Dec 15, 7:25 pm, prem1er wrote: > > > Didn't know about

Re: List a model fields

2008-12-16 Thread bruno desthuilliers
On 16 déc, 07:53, JF Simon wrote: > Hello, i'm new with python (and french so my english may seem very > poor, sorry about that). > I would like to list a model's fields and return a dict, here is the > example : > > I have a model class with : > > meta_title : CharField(...) >

Re: Django Forms Date Format

2008-12-16 Thread Aldo
Thanks Karen, Using a combination of both the links you provided I sorted it. I just needed to change my form slightly class MyForm(ModelForm): mydate = forms.DateTimeField(input_formats=['%d-%m-%Y']) class Meta: model = MyObject Thanks again for pointing me the right

Re: List a model fields

2008-12-16 Thread JF Simon
thanks dude. any idea to split the dict on the _ char ? recursive function ? --~--~-~--~~~---~--~~ 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

Re: Multi-table inheritance child type

2008-12-16 Thread sajal
Hi Malcom, Thanks for your help. Being a noob this was the first time i used the save() method and it just rocks! Issue solved. Regards, Sajal On Dec 15, 7:04 am, Malcolm Tredinnick wrote: > On Sun, 2008-12-14 at 15:43 -0800, sajal wrote: > > when using Multi-table

Is this a bug in FormWizard?

2008-12-16 Thread 朱穆穆
The extra_context in FormWizard is a class attribute so the new request may get the context of the previous request. I can prepend below to __call__ method to solved it: self.extra_context = self.extra_context.copy() Is this really a bug? --~--~-~--~~~---~--~~

Is this a bug in FormWizard?

2008-12-16 Thread 朱穆穆
The extra_context in FormWizard is a class attribute so the new request may get the context of the previous request. I can prepend below to __call__ method to solved it: self.extra_context = self.extra_context.copy() Is this really a bug? --~--~-~--~~~---~--~~

filter_horizontal

2008-12-16 Thread Matt Davies
Hello everyone I'd like to know everything there is to know about using the filter_horizontal method when displaying admin backend choices. I want to re-engineer it. I was wondering if anyone has done anything like this and could give me a couple of pointers to get started. Any assistance as