Two forms one page

2009-02-08 Thread tsop
Hello, I have a small problem here, I want to display two forms on the same page and I need both forms to validate/submit independently from one another. The problem I am having is that there is no way to tell which form is being submitted to, if they are both left empty and one submit is clicked

Re: mod_python and import path

2009-02-08 Thread Bradley Wright
On Feb 8, 4:39 am, Jeff wrote: > I installed django today and have not been able to get it to work with > apache, or itself really.  I have the path in the sys.path and have > set the settings module to point to it, but it cannot find it.  It > works fine when I use 'python

Re: Two forms one page

2009-02-08 Thread tsop
Oh thanks! I didn't realize you could do that, it works now. I am using request.POST.__contains__(key), I think this is what you meant. =) Titus On Feb 8, 4:25 am, Horst Gutmann wrote: > You could also assign the submit buttons a name (each its own name), > check

Re: Two forms one page

2009-02-08 Thread Horst Gutmann
You realize that you could simply do something like this to check if 'somefield' is a key in request.POST? if 'somefield' in request.POST: ... ;-) On Sun, Feb 8, 2009 at 10:52 AM, tsop wrote: > Oh thanks! > I didn't realize you could do that, it works now. > I am

Re: Two forms one page

2009-02-08 Thread Masklinn
On 8 Feb 2009, at 10:18 , tsop wrote: > The view: > http://dpaste.com/118076/ > > The template: > http://dpaste.com/118077/ > > > King Regards, > Titus Since the forms seem pretty much disjoint, and are completely separated on the page itself (it's not like you're mixin two django Forms in

Upload ZIP-File into Database

2009-02-08 Thread Robert
Dear Community, I have a ZIP-File which contains five .lst-Files. I want to fill with these five files a mysql-database. Is there a possibility to handle this via the admin interface? I tried the following but it doesn't work: from django import forms from django.contrib import admin from

Re: Iterating over a dictionary in templates

2009-02-08 Thread Carlos Pero
Oh excellent. New in 1.0, that makes sense. Thanks for the pointer. On Feb 5, 10:00 am, Alex Gaynor wrote: > On Thu, Feb 5, 2009 at 10:21 AM, Carlos Pero wrote: > > > Searching this group, I found a number of ways to iterate over a > > dictionary

Re: Upload ZIP-File into Database

2009-02-08 Thread Karen Tracey
On Sun, Feb 8, 2009 at 7:24 AM, Robert wrote: > > Dear Community, > > I have a ZIP-File which contains five .lst-Files. I want to fill with > these five files a mysql-database. Is there a possibility to handle > this via the admin interface? I tried the following but it

Re: mod_python and import path

2009-02-08 Thread Jeff
On Feb 8, 4:29 am, Bradley Wright wrote: > On Feb 8, 4:39 am, Jeff wrote: > > > I installed django today and have not been able to get it to work with > > apache, or itself really.  I have the path in the sys.path and have > > set the settings module

Re: mod_python and import path

2009-02-08 Thread Karen Tracey
On Sun, Feb 8, 2009 at 9:44 AM, Jeff wrote: > On Feb 8, 4:29 am, Bradley Wright wrote:> > > And if you're really using mod_python already with Apache, also post > > your vhost file. > vhost file: > #Block conf >

DHTML Grid

2009-02-08 Thread Manoj
Hello, I need to dynamically add rows to table similar to what has been done in http://dhtmlgrid.sourceforge.net/debug/demo.htm. This code was released in 2003 i wonder do we have code that i can use in my project. I am not sure about the robustness of the code. Thanks in advance. Regards,

Re: Postgresql v MySQL

2009-02-08 Thread Peter2108
Thanks. Between posting and your response I found out that MySQL has built in support for full-text searchs but PostgreSQL does not. But Django seems as happy with the one as the other. -- Peter On Feb 7, 2:06 pm, Tim Chase wrote: > > Is there any clear reason

Re: Postgresql v MySQL

2009-02-08 Thread Petite Abeille
On Feb 8, 2009, at 5:17 PM, Peter2108 wrote: > Thanks. Between posting and your response I found out that MySQL > has built in support for full-text searchs but PostgreSQL does not. Hmmm... http://www.postgresql.org/docs/8.3/static/textsearch.html -- PA. http://alt.textdrive.com/nanoki/

Re: Postgresql v MySQL

2009-02-08 Thread Alex Gaynor
On Sun, Feb 8, 2009 at 11:20 AM, Petite Abeille wrote: > > > On Feb 8, 2009, at 5:17 PM, Peter2108 wrote: > > > Thanks. Between posting and your response I found out that MySQL > > has built in support for full-text searchs but PostgreSQL does not. > > Hmmm... > >

Re: mod_python and import path

2009-02-08 Thread Jeff
On Feb 8, 9:52 am, Karen Tracey wrote: > On Sun, Feb 8, 2009 at 9:44 AM, Jeff wrote: > > On Feb 8, 4:29 am, Bradley Wright wrote:> > > > And if you're really using mod_python already with Apache, also post > > > your vhost file. > >

Re: Postgresql v MySQL

2009-02-08 Thread Justin Bronn
On Feb 7, 8:06 am, Tim Chase wrote: > PostgreSQL has built-in GIS data-types and functions, which I > believe are required for theGeoDjangofunctionality (or Oracle). >   PG also allows flexible creation of new data-types and > functions/operators as shown by the

admin "Documentation" link not visible

2009-02-08 Thread adrian
The doc under "Using the built-in reference" says: Django's admin interface includes a complete reference of all template tags and filters available for a given site. To see it, go to your admin interface and click the "Documentation" link in the upper right of the page. But I don't have

Re: admin "Documentation" link not visible

2009-02-08 Thread Alex Gaynor
On Sun, Feb 8, 2009 at 12:32 PM, adrian wrote: > > > The doc under "Using the built-in reference" says: > > Django's admin interface includes a complete reference of all > template tags and filters available > for a given site. To see it, go to your admin interface and

pre-populating multiplechoicefields with session data

2009-02-08 Thread Bobby Roberts
Hi group. Please look at this view: # this form runs the search mechanism def DoSearchForm (request): if request.method =='POST': form=SearchForm (request.POST) if form.is_valid(): try: myuid=request.user.id * 1 except:

Anyone hosting Django based site/app on EC2?

2009-02-08 Thread ydjango
Is anyone hosting their Django based site with Mysql db on Amazon ec2? How has been your experience in terms of 1) Cost (pay for what you use versus dedicated server model). 2) Scaling 3) Maintenance effort needed 4) Load balancing and fail over 5) Reliability

Re: Admin site not using my overridden save()?

2009-02-08 Thread Silfheed
Arrrg. Ok, so all typo's fixed, the code does work correctly... so there must be a rogue try except block out there intercepting errors and not sending them on to my logger. Thanks On Feb 6, 7:38 am, Karen Tracey wrote: > On Thu, Feb 5, 2009 at 2:08 PM, Silfheed

Exception in Django's Exception Handling

2009-02-08 Thread Devel63
Django is raising an exception while trying to process an exception, resulting in no stack traces ... for many different types of errors. It has the problem in debug.py, at this line under technical_500_response: return HttpResponseServerError(t.render(c), mimetype='text/html') I have

Re: Postgresql v MySQL

2009-02-08 Thread AmanKow
I started with mysql and moved to postgres. My main reasons: 1) If you ever need to dumpdata/loaddata, you may find that postgres (correctly) defers checking of fk constraints until after the a transaction is complete. MySQL checks the constraints as each record is added, even inside of a

Extending the User model

2009-02-08 Thread Patricio Palma
Greetings I have a model from django.contrib.auth.models import User class MyUser(User): chilean_rut = CLRutField(_('RUT'),primary_key=True) class Meta: admin = meta.Admin( fields = ( (_('Personal info'), {'fields': ('first_name', 'last_name',

Re: Extending the User model

2009-02-08 Thread Alex Gaynor
On Sun, Feb 8, 2009 at 3:06 PM, Patricio Palma wrote: > > Greetings > > I have a model > > from django.contrib.auth.models import User > class MyUser(User): > >chilean_rut = CLRutField(_('RUT'),primary_key=True) > >class Meta: > > admin = meta.Admin( >

Re: mod_python and import path

2009-02-08 Thread Bradley Wright
On Feb 8, 4:25 pm, Jeff wrote: > I actually got it to work by changing the PYTHONPATH from '/var/www/ > django/legend' to just '/var/www/django'.  Not sure if this is only > due to my version of python or what.  But thank you for the help. It's because Python tries to look

How to detect inactivity session time out?

2009-02-08 Thread ydjango
I am setting inactivity session time out using - a) request.session.set_expiry(900) and b) SESSION_COOKIE_AGE = 900 I believe both work exactly the same way. Please correct me if they have any different behavior. How do I detect this time out in my app and give user a page that

Extending the User model

2009-02-08 Thread Patricio Palma
Greetings I've a model class MyUser(auth.User): location = meta.CharField(maxlength=100, blank=True) class META: replaces_module = 'auth.users' admin = meta.Admin( list_display = ('username', 'email', 'first_name','last_name', 'lacation')

Adding fields to model objects that don't correspond to database state

2009-02-08 Thread Jack Orenstein
I have a model object that looks something like this: class Foo(models.Model) foo_id = models.IntegerField(primary_key = True) xyz = models.CharField(max_length = 20) In my application, I'd like to add a list of Bar objects. It's like a foreign key, except that Bar objects

Re: Extending the User model

2009-02-08 Thread Patricio Palma
> This code looks exceptionally old, admin = meta.Admin() has been gone for > several years, what version of django are you workign with? > 1.1 pre-alpha I 've in admin.py file, the main idea was show the list_display field setted --~--~-~--~~~---~--~~ You

Re: Adding fields to model objects that don't correspond to database state

2009-02-08 Thread Alex Koshelev
try this: def attach_bar(self, bar): if getattr(self, "bars", None) is None: self.bars = [] self.bars.append(bar) On Mon, Feb 9, 2009 at 12:03 AM, Jack Orenstein wrote: > > I have a model object that looks something like this: > >

Re: Extending the User model

2009-02-08 Thread Daniel Roseman
On Feb 8, 9:06 pm, Patricio Palma wrote: > > This code looks exceptionally old, admin = meta.Admin() has been gone for > > several years, what version of django are you workign with? > > 1.1 pre-alpha > I 've in admin.py file, the main idea was show the list_display

Re: Extending the User model

2009-02-08 Thread Patricio Palma
At revision 9820. ??? --~--~-~--~~~---~--~~ 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 this group, send email to

Re: Extending the User model

2009-02-08 Thread Karen Tracey
On Sun, Feb 8, 2009 at 5:33 PM, Patricio Palma wrote: > > At revision 9820. > > ??? > ??? indeed. What doc are you reading that suggests having something like "admin = meta.Admin(..." under class Meta of your model definition? I've never seen anything like it but

Re: Exception in Django's Exception Handling

2009-02-08 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 4:20 AM, Devel63 wrote: > > Django is raising an exception while trying to process an exception, > resulting in no stack traces ... for many different types of errors. > > It has the problem in debug.py, at this line under > technical_500_response: >

MySQLdb for Python 2.6 on win32

2009-02-08 Thread Technicalbard
If you are looking for this, I compiled it using MSVC++2008 Express, against MySQL 5.0.67 using Python 2.6 and the MySQLdb 1.2.2 source: http://www.technicalbard.com/files/MySQL-python-1.2.2.win32-py2.6.exe Hope it helps anyone who was looking.

Re: Exception in Django's Exception Handling

2009-02-08 Thread Karen Tracey
On Sun, Feb 8, 2009 at 2:20 PM, Devel63 wrote: > > Django is raising an exception while trying to process an exception, > resulting in no stack traces ... for many different types of errors. > > It has the problem in debug.py, at this line under > technical_500_response: >

Re: Traceback in the ``runserver`` console

2009-02-08 Thread rz
I too would like to have this functionality. Has anyone opened a ticket and/or started working on a patch? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Adding project revision number to templates.

2009-02-08 Thread Dana
Hi all, Wondering what the best approach would be to add my projects revision number to my projects admin? I would like to show the revision number of my SVNed project in my admin templates so I can easily see what version each client is running. How would one go about doing this? Thanks!

Re: Adding project revision number to templates.

2009-02-08 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 8:17 AM, Dana wrote: > > Hi all, > > Wondering what the best approach would be to add my projects revision > number to my projects admin? I would like to show the revision number > of my SVNed project in my admin templates so I can easily see what >

Re: Adding project revision number to templates.

2009-02-08 Thread James Bennett
On Sun, Feb 8, 2009 at 5:21 PM, Russell Keith-Magee wrote: > 1) Look at django.utils.version.get_svn_revision(). This method tells > you Django's SVN revision. Make a copy of this method and modify it to > point at your own code, telling you the version of your clients

Best practice question: subclassing external app components

2009-02-08 Thread zinckiwi
Hi folks, I'm just starting to play with django-registration and I want to subclass the RegistrationForm for a couple of cosmetic tweaks (capitalising the labels on the fields -- there may be a simpler way to do this, but indulge me for the purposes of this question). I understand that

Re: Postgresql v MySQL

2009-02-08 Thread richr
Barry Pederson has nice, short example of adding PostgreSQL full text search to an existing Djanog app at: http://barryp.org/blog/entries/postgresql-full-text-search-django/ On Feb 8, 11:22 am, Alex Gaynor wrote: > On Sun, Feb 8, 2009 at 11:20 AM, Petite Abeille >

Re: Extending the User model

2009-02-08 Thread Patricio Palma
Yeah you're right I can't believe that I mix the admin settings in the class, for a short explanation. my code: --- models.py from django.contrib.auth.models import User class MyUser(User): chilean_rut =

Re: pre-populating multiplechoicefields with session data

2009-02-08 Thread Bobby Roberts
anyone have any idea on this? --~--~-~--~~~---~--~~ 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 this group, send email to

Re: Adding project revision number to templates.

2009-02-08 Thread Dana Woodman
Thank you both! That is exactly what I was looking for! Cheers On Sun, Feb 8, 2009 at 3:34 PM, James Bennett wrote: > > On Sun, Feb 8, 2009 at 5:21 PM, Russell Keith-Magee > wrote: > > 1) Look at django.utils.version.get_svn_revision(). This

Re: converting a string object into class object

2009-02-08 Thread Saurav
Thanks Daniel and Bruno, your tips were gr8. It helped me out a lot. I am a newbie in python as well as Django, and I m trying to learn them ASAP. I had to finish some work quickly and so had pushed the question here. Thanks anyways -Saurav On Feb 6, 2:24 pm, bruno desthuilliers

Problem with set_language generic view

2009-02-08 Thread yav
Hello, I have a problem with the generic view set_language. I used it but it doesn't change the language. I have read the doc but I didn't find what is the problem. I have read the doc but I didn't find what is the problem. I have setup an empty project in order test it with a very simple

Re: problem with simple shopping cart

2009-02-08 Thread lnysrogh
Thank you so much. That helped a lot. Such a simple mistake. I've got some other questions now. My "add to cart" code: def add(request, product_id): added = (Product.objects.get(id=product_id), 1) # '1' is quantity request.session.set_test_cookie() if

Testing Django and HTTP Request

2009-02-08 Thread Vitaly Babiy
Hello everyone, I am working on a project that will need to make a request out to the web and pull down some data, For testing purpose I was wonder what would be the best way to test this. I don't want to make the actual request during the test, because for one if I am off-line all those tests

Re: Testing Django and HTTP Request

2009-02-08 Thread Alex Gaynor
On Mon, Feb 9, 2009 at 12:06 AM, Vitaly Babiy wrote: > Hello everyone, > > I am working on a project that will need to make a request out to the web > and pull down some data, For testing purpose I was wonder what would be the > best way to test this. I don't want to make the

Re: Testing Django and HTTP Request

2009-02-08 Thread Vitaly Babiy
Right the problem is if I reload the server on ever test, there is not enough time for the thread to kill the server. So when the next setUp comes around the port is still in use. I think I need to find a way to start a HTTP server at the beginning of the test and keep it around till all test are

Working with URL Fields in django test.

2009-02-08 Thread Vitaly Babiy
Hello, If I am using a URLField in form and it set to verify the URL, if I write tests for the code and in the post I push a url like *http:google.com *it will fail if the computer is off-line. Is there a good fix for this? Vitaly Babiy --~--~-~--~~~---~--~~ You

Re: Testing Django and HTTP Request

2009-02-08 Thread Alex Gaynor
On Mon, Feb 9, 2009 at 12:13 AM, Vitaly Babiy wrote: > Right the problem is if I reload the server on ever test, there is not > enough time for the thread to kill the server. So when the next setUp comes > around the port is still in use. > I think I need to find a way to

Re: Testing Django and HTTP Request

2009-02-08 Thread Vitaly Babiy
Yea, but I see a few problems whit that solution: - Hacky - Still not guaranteed to work( it could take more time) - Would really slow down the tests Vitaly Babiy On Mon, Feb 9, 2009 at 12:15 AM, Alex Gaynor wrote: > > > On Mon, Feb 9, 2009 at 12:13 AM, Vitaly

Re: Testing Django and HTTP Request

2009-02-08 Thread Alex Gaynor
On Mon, Feb 9, 2009 at 12:18 AM, Vitaly Babiy wrote: > Yea, but I see a few problems whit that solution: > >- Hacky >- Still not guaranteed to work( it could take more time) >- Would really slow down the tests > > Vitaly Babiy > > > On Mon, Feb 9, 2009 at 12:15

Re: Testing Django and HTTP Request

2009-02-08 Thread Vitaly Babiy
Yeah, it does. I am going to have to look to see if can find a better stand alone server to do this instead of patching django. Vitaly Babiy On Mon, Feb 9, 2009 at 12:22 AM, Alex Gaynor wrote: > > > On Mon, Feb 9, 2009 at 12:18 AM, Vitaly Babiy

Re: Testing Django and HTTP Request

2009-02-08 Thread Alex Gaynor
On Mon, Feb 9, 2009 at 12:28 AM, Vitaly Babiy wrote: > Yeah, it does. I am going to have to look to see if can find a better stand > alone server to do this instead of patching django. > > Vitaly Babiy > > > On Mon, Feb 9, 2009 at 12:22 AM, Alex Gaynor

What is the Difference between get() and filter() functions in Django Framework

2009-02-08 Thread gganesh
hi , help to find the difference between get() and filter() function in django ,both seems to retrieve records from data base . Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: What is the Difference between get() and filter() functions in Django Framework

2009-02-08 Thread Alex Gaynor
On Mon, Feb 9, 2009 at 12:37 AM, gganesh wrote: > > hi , > help to find the difference between get() and filter() function in > django ,both seems to retrieve records from data base . > Thanks > > > > filter() returns another QuerySet, that is it returns multiple objects,

Flup:Unhandled Exception

2009-02-08 Thread madhav
Hi all, I am facing the dreaded "Unhandled Exception" raised by Flup. The sad part is its raised at the webserver(lighttpd+flup) level and not at the application level(Django). So no 500 email is raised about where the problem is. Our entire team struggled hard to cleanup the codebase, incase of

Re: Flup:Unhandled Exception

2009-02-08 Thread Dj Gilcrease
On Sun, Feb 8, 2009 at 11:17 PM, madhav wrote: > checked the lighttpd logs, all I see is "Interface Error/Connection > already closed." Its only occuring when my applicaiton is running in > FCGI mode. so the problem is with how flup is actually dealing with my >