Custom Validation in Django 1.0.2 Final

2009-04-06 Thread Harish
Hi Folks, I am wrote a simple application in djang0 1.0.2 to check the custom validation. I will past the model.py and admin.py code here. model.py --- from django.db import models from django.contrib import admin from django import forms class Personal(models.Model): firstName = mo

Re: wsgi.WSGIHandler:how to get a WebOb Request at first place

2009-04-06 Thread Malcolm Tredinnick
On Mon, 2009-04-06 at 23:31 -0700, Coonay wrote: > > > On Apr 7, 12:54 pm, Graham Dumpleton > wrote: > > On Apr 7, 2:33 pm, Coonay wrote: > > > > > i want to get a WebOb Request ASAP when the WSGIHandler is called,such > > > as retrieve the SERVER_NAME and SERVER_PORT meta information from the

Re: wsgi.WSGIHandler:how to get a WebOb Request at first place

2009-04-06 Thread Graham Dumpleton
On Apr 7, 4:31 pm, Coonay wrote: > On Apr 7, 12:54 pm, Graham Dumpleton > wrote: > > > On Apr 7, 2:33 pm, Coonay wrote: > > > > i want to get a WebOb Request ASAP when the WSGIHandler is called,such > > > as retrieve the SERVER_NAME and SERVER_PORT meta information from the > > > request,my s

Re: wsgi.WSGIHandler:how to get a WebOb Request at first place

2009-04-06 Thread Coonay
On Apr 7, 12:54 pm, Graham Dumpleton wrote: > On Apr 7, 2:33 pm, Coonay wrote: > > > i want to get a WebOb Request ASAP when the WSGIHandler is called,such > > as retrieve the SERVER_NAME and SERVER_PORT meta information from the > > request,my stupid idea is in the line 261 of wsgi.py that ad

Re: Validate with PIL

2009-04-06 Thread Ayaz Ahmed Khan
On 06-Apr-09, at 3:37 AM, CrabbyPete wrote: > > I installed the PIL Imaging library and when I validate my model I > get the error that I need the imaging library. I'm using Python 2.6. What's the exact error? Does it complain of a certain decoder not being available? Does it work when you load

Re: Running django on a web hosting account

2009-04-06 Thread Graham Dumpleton
On Apr 7, 12:13 pm, dls wrote: > Webfaction is not free, but offers some > pretty impressive setups for Django websites (as well as many other > language), and have competitive pricing. > > They will do an install of the necessary libraries and modules for > whateve

Re: wsgi.WSGIHandler:how to get a WebOb Request at first place

2009-04-06 Thread Graham Dumpleton
On Apr 7, 2:33 pm, Coonay wrote: > i want to get a WebOb Request ASAP when the WSGIHandler is called,such > as retrieve the SERVER_NAME and SERVER_PORT meta information from the > request,my stupid idea is in the line 261 of wsgi.py that add > following : > >         server_name =  request.META

wsgi.WSGIHandler:how to get a WebOb Request at first place

2009-04-06 Thread Coonay
i want to get a WebOb Request ASAP when the WSGIHandler is called,such as retrieve the SERVER_NAME and SERVER_PORT meta information from the request,my stupid idea is in the line 261 of wsgi.py that add following : server_name = request.META['SERVER_NAME'] if ( server_name is not

Re: Can I just put user id in session for authorization purpose?

2009-04-06 Thread Zeal
Hi Malcolm, Thanks for your clear explanation. I've already done the authorization function by myself, if you are interesting in it, you could refer to following coding. After analysising django's auth module, I just gave it up for some integration reason. However, I copied some useful function f

Re: Untouched admin templates throwing TemplateSyntaxError

2009-04-06 Thread Karen Tracey
On Mon, Apr 6, 2009 at 5:22 PM, Jacolyte wrote: > > Right after logging into the admin interface, I receive the following > traceback: > > http://dpaste.com/25126/ > So, it's running into trouble on: {% get_admin_log 10 as admin_log for_user user %} and the extent of the exception information

Re: Looking for a django job

2009-04-06 Thread Alex Gaynor
On Mon, Apr 6, 2009 at 11:04 PM, Joshua Partogi wrote: > > Dear all, > > Is there any other website that posts django jobs besides > http://djangogigs.com/ ? > > I'm looking for a django job. > > Thank you very much in advance > > -- > If you can't believe in God the chances are your God is too sm

Re: Running django on a web hosting account

2009-04-06 Thread Kenneth Gonsalves
On Tuesday 07 April 2009 07:45:15 dls wrote: > Ahhh - and has Nick Lo has clearly indicated, you should check out > Djangofriend.com, which lists Webfaction as the #1 Django hosting > site :) I missed that bit when I responded the first time. djangofriendly.com - when I last looked -- regards kg

Looking for a django job

2009-04-06 Thread Joshua Partogi
Dear all, Is there any other website that posts django jobs besides http://djangogigs.com/ ? I'm looking for a django job. Thank you very much in advance -- If you can't believe in God the chances are your God is too small. Read my blog: http://joshuajava.wordpress.com/ Follow me on twitter:

Re: mod_python error

2009-04-06 Thread Karen Tracey
On Mon, Apr 6, 2009 at 5:35 PM, skunkwerk wrote: > > Hi, > i've been trying to figure out why i'm getting this error (i > removed the 500.html template to view the traceback, but am not sure > what's causing the unhandled exception in the first place). any > ideas? > Removing the 500.html tem

Re: Running django on a web hosting account

2009-04-06 Thread dls
Ahhh - and has Nick Lo has clearly indicated, you should check out Djangofriend.com, which lists Webfaction as the #1 Django hosting site :) I missed that bit when I responded the first time. -dls On Apr 6, 10:13 pm, dls wrote: > Webfaction is not free, but offers s

Re: Running django on a web hosting account

2009-04-06 Thread Alex Gaynor
On Mon, Apr 6, 2009 at 10:13 PM, dls wrote: > > Webfaction is not free, but offers some > pretty impressive setups for Django websites (as well as many other > language), and have competitive pricing. > > They will do an install of the necessary libraries and modules

Re: Running django on a web hosting account

2009-04-06 Thread dls
Webfaction is not free, but offers some pretty impressive setups for Django websites (as well as many other language), and have competitive pricing. They will do an install of the necessary libraries and modules for whatever language you select - and they can do multi

Re: Multiple databases/engines

2009-04-06 Thread Malcolm Tredinnick
On Mon, 2009-04-06 at 21:22 -0300, Marcello Parra wrote: > Hello, > > I started to play with Django some weeks ago. I'm very impressed with > it and making some tests with an application I have already running... > > The problem is that I need to connect to two databases using two > different en

Multiple databases/engines

2009-04-06 Thread Marcello Parra
Hello, I started to play with Django some weeks ago. I'm very impressed with it and making some tests with an application I have already running... The problem is that I need to connect to two databases using two different engines (MS SQL Server and Mysql). I found a doc about using 2 databases h

Untouched admin templates throwing TemplateSyntaxError

2009-04-06 Thread Jacolyte
Right after logging into the admin interface, I receive the following traceback: http://dpaste.com/25126/ I've only changed two major things with the project: 1) I've added support for markup, which is working beautifully 2) I've added a context processor, which simply gives me access to my sett

Global filter

2009-04-06 Thread didier rano
Hi all, I need to implement a global filter with Django, but I cannot find a generic method. What I mean by global filter ? Example: In a menu (tabs), users can choose between movies, music, books or all news. This filter is used by almost all Django views as a queryset filter for example, or in te

Re: Still Learning...!

2009-04-06 Thread Russell Keith-Magee
On Tue, Apr 7, 2009 at 2:14 AM, dls wrote: > > I think the easiest way to get started is to follow the "Creating a > project" instructions from the Django documentation: > > http://docs.djangoproject.com/en/dev/intro/tutorial01/#intro-tutorial01 > > It is my understanding that these steps are nec

Re: Cannot get admin to order rows properly

2009-04-06 Thread Malcolm Tredinnick
On Mon, 2009-04-06 at 13:27 -0400, Karen Tracey wrote: [...] > > Multi-column ordering has been requested before, you might try > searching the list and tracker for details on why it's not being done > now. One of the big reasons this isn't available is that it's quite a challenging UI problem

Re: Django assumes commit will succeed - consumes the exception

2009-04-06 Thread Malcolm Tredinnick
On Mon, 2009-04-06 at 07:05 -0700, Anssi Kaariainen wrote: > I ran to an problem when playing around with Postgresql deferred > constraint triggers. While deferred constraint triggers themselves are > not too important for Django, the consuming of on-commit DB errors > is. > > I will go through t

select_related and 1-to-many relations

2009-04-06 Thread Ceph
I have the following models: class User(models.Model): pass class Item(Models.Mode): created = models.DateTime(default=datetime.now) user = models.ForeignKey(User, related_name="items") class Meta: ordering = ("-created",) get_latest_by = "created" So a user can

Re: Error creating test database

2009-04-06 Thread Russell Keith-Magee
On Mon, Apr 6, 2009 at 10:03 PM, Andrew G. wrote: > > Specifying "through" instead of "db_table" did not raise any errors, > but it caused the relevant field in the admin change form to > disappear! This is to be expected. m2m intermediate tables don't get the same treatment in the admin as norm

Re: Running django on a web hosting account

2009-04-06 Thread atik
Is there any free hosting site that provide django support? --~--~-~--~~~---~--~~ 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

Re: Running django on a web hosting account

2009-04-06 Thread Nick Lo
> So i have created a django project and now want to run it in my > hosting accounct. What is needed to do? I mean what should they > provide or what should i need to install there? You don't give very much information about what project you have created or what your hosting account is, so it's

Running django on a web hosting account

2009-04-06 Thread atik
So i have created a django project and now want to run it in my hosting accounct. What is needed to do? I mean what should they provide or what should i need to install there? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

mod_python error

2009-04-06 Thread skunkwerk
Hi, i've been trying to figure out why i'm getting this error (i removed the 500.html template to view the traceback, but am not sure what's causing the unhandled exception in the first place). any ideas? thanks MOD_PYTHON ERROR ProcessId: 10894 Interpreter:'domU-12-31-39-03-BD-34.

Re: Default items in a template

2009-04-06 Thread Briel
If the links are static, you could just hardcode them into the base template. That would probably be a bit faster to do, but not as flexible as a tag would be. ~Jakob On Apr 6, 7:38 pm, Alex Gaynor wrote: > On Mon, Apr 6, 2009 at 11:54 AM, koranthala wrote: > > > Hi, > >    I have many pages i

Re: textarea in ModelForm

2009-04-06 Thread Alex Gaynor
On Mon, Apr 6, 2009 at 3:46 PM, grimmus wrote: > > Thanks for the reply. > > I dont get an error anymore but nothing appears now, not even a > textbox ! Please see my model below > > from django.db import models > from django import forms > from django.forms import ModelForm > > import datetime >

Re: textarea in ModelForm

2009-04-06 Thread grimmus
Thanks for the reply. I dont get an error anymore but nothing appears now, not even a textbox ! Please see my model below from django.db import models from django import forms from django.forms import ModelForm import datetime ENQUIRY_TYPES = ( ('Allergy Testing','Allergy Testing'), ('

Re: textarea in ModelForm

2009-04-06 Thread Alex Gaynor
On Mon, Apr 6, 2009 at 2:04 PM, grimmus wrote: > > Hi, > > I am trying to create a text area for a form that is generated through > ModelForm. > > The field i have is > > enquiry = models.CharField(widget=models.Textarea) > > but i get the error > > 'module' object has no attribute 'Textarea' > >

Re: need a multiselect list box for a static list of options

2009-04-06 Thread Adam Fraser
Yeah, I just realized I'm running django 0.97 On Apr 6, 1:32 pm, Karen Tracey wrote: > On Mon, Apr 6, 2009 at 11:57 AM, Adam Fraser wrote: > > > > > Does anyone have a clue why I can't access ModelAdmin in > > django.contrib.admin? > > > >>> from django.contrib import admin > > >>> dir(admin) >

Re: Cannot get admin to order rows properly

2009-04-06 Thread Andrew Grossman
Thank you. On Apr 6, 1:27 pm, Karen Tracey wrote: > On Mon, Apr 6, 2009 at 11:13 AM, Andrew Grossman wrote: > > > > > I am trying to specify multiple columns for Django to order row in the > > admin change list by, but it seems to only be interested in ordering > > by the first column.  Am I doi

Re: need a multiselect list box for a static list of options

2009-04-06 Thread Karen Tracey
On Mon, Apr 6, 2009 at 11:57 AM, Adam Fraser wrote: > > Does anyone have a clue why I can't access ModelAdmin in > django.contrib.admin? > > >>> from django.contrib import admin > >>> dir(admin) > ['__builtins__', '__doc__', '__file__', '__name__', '__path__', > 'models'] > > ??? > That's the res

textarea in ModelForm

2009-04-06 Thread grimmus
Hi, I am trying to create a text area for a form that is generated through ModelForm. The field i have is enquiry = models.CharField(widget=models.Textarea) but i get the error 'module' object has no attribute 'Textarea' I have tried a few variations but with no luck, Any ideas ? Thanks in

Re: Still Learning...!

2009-04-06 Thread dls
I think the easiest way to get started is to follow the "Creating a project" instructions from the Django documentation: http://docs.djangoproject.com/en/dev/intro/tutorial01/#intro-tutorial01 It is my understanding that these steps are necessary if you want to use the Django framework. I think

Re: Default items in a template

2009-04-06 Thread Alex Gaynor
On Mon, Apr 6, 2009 at 11:54 AM, koranthala wrote: > > Hi, >I have many pages in my website - and all have the same default > header and side bars. The header and sidebar contains ~15 links which > are constant every time. While rendering templates for these pages, I > always have to send all

Re: need a multiselect list box for a static list of options

2009-04-06 Thread Alex Gaynor
On Mon, Apr 6, 2009 at 1:40 PM, Adam Fraser wrote: > > Yeah, I just realized I'm running django 0.97 > > On Apr 6, 1:32 pm, Karen Tracey wrote: > > On Mon, Apr 6, 2009 at 11:57 AM, Adam Fraser >wrote: > > > > > > > > > Does anyone have a clue why I can't access ModelAdmin in > > > django.contri

Re: Django, Dojo and JSON-RPC

2009-04-06 Thread Jani Tiainen
Top posting is not my favorite one. I'm using Dojo JSON-RPC service. Previously with PHP + Zend I got almost automated JSON-RPC server + SMD generation. I'm using dojo.rpc.JsonService to for example save and retrieve data in Web 2.0 manner. Works great. I found nice solution with (or without)

Re: Cannot get admin to order rows properly

2009-04-06 Thread Karen Tracey
On Mon, Apr 6, 2009 at 11:13 AM, Andrew Grossman wrote: > > I am trying to specify multiple columns for Django to order row in the > admin change list by, but it seems to only be interested in ordering > by the first column. Am I doing something wrong here? > The admin only orders by one column.

Re: Form wizard - previous step

2009-04-06 Thread eli
Thank You Elliott. regards. On 6 Kwi, 11:52, Elliott wrote: > On Apr 5, 4:24 pm, eli wrote: > > > No, how to add  functionality to back to the previous step without > > deleting current step's data. > > > regards. > > That can't be done with the current form wizard. A session-based > formwizar

Re: need a multiselect list box for a static list of options

2009-04-06 Thread Adam Fraser
Does anyone have a clue why I can't access ModelAdmin in django.contrib.admin? >>> from django.contrib import admin >>> dir(admin) ['__builtins__', '__doc__', '__file__', '__name__', '__path__', 'models'] ??? I'm trying to do this: class ProjectAdmin(admin.ModelAdmin): formfield_overrides

Default items in a template

2009-04-06 Thread koranthala
Hi, I have many pages in my website - and all have the same default header and side bars. The header and sidebar contains ~15 links which are constant every time. While rendering templates for these pages, I always have to send all these links in the context. Since it is unseemly, I am plannin

Still Learning...!

2009-04-06 Thread TP
Hi, Just wondering what the best way to add Django Apps to a webpage is? Is is best to create the Apps first then add them to the website? Or visa versa? I have a created HTML Website and want to add a Calendar & Django- Registration App to it. I have read the documentation but I am still a l

Re: Cannot get admin to order rows properly

2009-04-06 Thread Andrew Grossman
http://i659.photobucket.com/albums/uu319/tsqd/ djangoorder.png"/> --~--~-~--~~~---~--~~ 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

Re: Cannot get admin to order rows properly

2009-04-06 Thread Andrew Grossman
Result: http://i659.photobucket.com/albums/uu319/tsqd/djangoorder.png (google groups seems to have issues with these links) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

Pluggable content types best practices

2009-04-06 Thread Peterw
For a project involving many kinds of content (photos, audio, text, polls, etc.) I have been trying to come up with a way to display any kind of content in any place on the front page. What this means is that, through the admin interface, I can specify the object (be it any kind of content) to be

Re: Cannot get admin to order rows properly

2009-04-06 Thread Andrew Grossman
admin.py: -- from django.contrib import admin from models import * class PositionAdmin(admin.ModelAdmin): list_display = ('description', 'order_first', 'order_second') ordering = ('order_first'

Re: Cannot get admin to order rows properly

2009-04-06 Thread Andrew Grossman
models.py: -- from django.db import models class Position(models.Model): order_first = models.IntegerField(db_index=True) order_second = models.IntegerField() description = models.CharField(max_len

Cannot get admin to order rows properly

2009-04-06 Thread Andrew Grossman
I am trying to specify multiple columns for Django to order row in the admin change list by, but it seems to only be interested in ordering by the first column. Am I doing something wrong here? --~--~-~--~~~---~--~~ You received this message because you are subs

Re: Django, Dojo and JSON-RPC

2009-04-06 Thread Rob Goedman
Jani, Not sure what you are trying to achieve. Wolfram suggested below solution to me a while ago and I'm happy with it. Rob On Apr 6, 2009, at 3:14 AM, Jani Tiainen wrote: > > I've been trying to find out nice solution to handle JSON-RPC with > Django and Dojo (Dojango). > > So far not much

admin & edit-inlines: how to get ordered_forms in case of error?

2009-04-06 Thread patrickk
let´s say I´m having inlines with a field "pub_date" and the ordering is set to pub_date. in the admin-interface, I´m changing the pub_date for several fields/inlines and trying to save. if there are no errors, everyting´s fine. however, if there are errors (somewhere on the page and not necessari

Django assumes commit will succeed - consumes the exception

2009-04-06 Thread Anssi Kaariainen
I ran to an problem when playing around with Postgresql deferred constraint triggers. While deferred constraint triggers themselves are not too important for Django, the consuming of on-commit DB errors is. I will go through the code to show what is happening: The problem is the function _commit_

Re: Error creating test database

2009-04-06 Thread Andrew G.
Specifying "through" instead of "db_table" did not raise any errors, but it caused the relevant field in the admin change form to disappear! On Apr 3, 4:52 pm, Karen Tracey wrote: > On Fri, Apr 3, 2009 at 4:25 PM, Andrew G. wrote: > > > The following code in a fresh project/app will cause the d

Re: Error creating test database

2009-04-06 Thread Andrew G.
Ahhh, that should solve my problem then. Thank you. I do however see a similar problem--if the PartPosition model is not defined, but both Part and Position specify to use the db_table part_positions, the database build still tries to create the table twice. On Apr 3, 4:52 pm, Karen Tracey wro

Re: Easy way to create pretty pages with nav?

2009-04-06 Thread dartdog1
Thanks Guys! On Apr 6, 3:55 am, Briel wrote: > I mostly agree with andy, getting a base template done as a static > page > would be a great place to start, and how you get it done is up to you > and how you work best. > > Step 2 imo would be to add block tags the correct places. Basically > you

Switching databases on the fly

2009-04-06 Thread Cormac Mulhall
Quick question. Is it possible to switch which database Django uses on the fly if the databases have identical schemes. I have a need to read from one database (slave and write changes back to a different database (master). So basically I want to populate a model object from the slave database, a

Django, Dojo and JSON-RPC

2009-04-06 Thread Jani Tiainen
I've been trying to find out nice solution to handle JSON-RPC with Django and Dojo (Dojango). So far not much avail. Has anyone succeeded with this? Care to share what kind of packages do I need to make it working with preferably automated SMD generations. -- Jani Tiainen --~--~-~--

Re: Form wizard - previous step

2009-04-06 Thread Elliott
On Apr 5, 4:24 pm, eli wrote: > No, how to add  functionality to back to the previous step without > deleting current step's data. > > regards. That can't be done with the current form wizard. A session-based formwizard that would have allowed this was on the list for django 1.1, but nobody real

Re: Problem with adding new columns to existing model.

2009-04-06 Thread Andy Mikhailenko
As Daniel suggested, try tools like django_evolution. With the latter you just do: $ ./manage.py evolve --hint -x This shows the changes to be made (--hint) and executes the migration (-x). That's it, the table structure is now synchronized to the Python class without the "alter table" pain. --~

Re: Easy way to create pretty pages with nav?

2009-04-06 Thread Briel
I mostly agree with andy, getting a base template done as a static page would be a great place to start, and how you get it done is up to you and how you work best. Step 2 imo would be to add block tags the correct places. Basically you want to place your tags in such a way that you only need to

Re: Django Template Question

2009-04-06 Thread Briel
If you are trying to construct a "base" template for several views you could also use the {% if %} tags, and only show the relevant parts of the page. For example, if you wanted to display a table, but the number om columns would vary, this would enable you to only display the needed columns. On

flat page url problem

2009-04-06 Thread grimmus
Hi, I was experimenting locally using flatpages. I didnt add anything extra into the urls.py file to handle these pages and they displayed correctly in the browser (using the django runserver) When i deploy my app to apache i get the error : The current URL, , didn't match any of these. My urls

Re: Easy way to create pretty pages with nav?

2009-04-06 Thread andybak
Nothing wrong with designing your site using visual tools. Get your basic page look and feel set up as a single static HTML + CSS. That page becomes your base template. Stick a single {{ content }} placeholder in and you can start inserting dynamic content into your template from any of your view

Re: Deploying django application

2009-04-06 Thread Oleg Oltar
There are few thing here: 1. I am root on that box. So can change apache conf. But have a little knowledge how to do it. So decided to use that way, as thought it's easier for hosting many django apps. So please tell me what to check. 2. I believe that htaccess is working as web server redirected

Re: Django Template Question

2009-04-06 Thread Daniel Roseman
On Apr 6, 6:38 am, codingJoe wrote: > Up front, I'm not the most elegant coder, so please forgive. > >   I have a page that is produced using django templates.   I used the > templates to do the header and footer, but now I'm down into the body > of the page.   Using the data from my template, I