Best practise on using Django forms in jQuery UI modal dialogue.

2009-04-24 Thread Chris Dew
I'd like to use something like the jQuery UI modal dialogues http://jqueryui.com/demos/dialog/#modal in a web application. My quandary is how to integrate this with Django. The 'base page' has multiple links, each of which will open up a different form in a modal dialogue. If the form in the di

Re: ManyToMany relationship being 'lost'?

2009-04-24 Thread Russell Keith-Magee
On Sat, Apr 25, 2009 at 2:32 AM, Rubens Altimari wrote: > Hello, > Sorry if this is a known issue, but I didn't find anything elsewhere. > I have these two models related by a many-to-many relationship. I'm using > the 'default' admin application to edit data, and in order to be able to > edit bo

Re: how to handle database down time gracefully?

2009-04-24 Thread James Bennett
On Fri, Apr 24, 2009 at 7:51 AM, realfun wrote: > I build a website(fayaa.com) on Bluehost using Django, but this month > database down 3 times, during that period, user can only see an > "Unexpected Exception" message, is there a way to redirect to a 404 > page instead? If you don't mind doing

Re: how to handle database down time gracefully?

2009-04-24 Thread Doug B
This has been on my todo list of a while now, so I thought I'd trying to figure it out. I -think- the proper way to go about this would be in a custom middleware with a process_exception handler that checks to see if the exception is an instanace of the database defined exceptions. Looking in dj

Re: how to handle database down time gracefully?

2009-04-24 Thread Mike Ramirez
On Friday 24 April 2009 04:51:54 am realfun wrote: > Hi, > > I build a website(fayaa.com) on Bluehost using Django, but this month > database down 3 times, during that period, user can only see an > "Unexpected Exception" message, is there a way to redirect to a 404 > page instead? > > Regards, > -

Re: how to handle database down time gracefully?

2009-04-24 Thread Timboy
I'm interested as well. You'd want to have a 500 with a nice unexpected maintanence message. On Apr 24, 4:51 am, realfun wrote: > Hi, > > I build a website(fayaa.com) on Bluehost using Django, but this month > database down 3 times, during that period, user can only see an > "Unexpected Exceptio

Re: providing extra info to the django.contrib.auth.views.password_change template

2009-04-24 Thread Ram
On Apr 25, 11:40 am, Ram wrote: -- snip -- > The problem is that password_change only takes the 'template_name' > parameter. > > Anyone got any tips on how to achieve what i want without writing my > own password change code :-) I'm hoping that i'm missing something > obvious. > > Cheers, > > ra

Re: Django turns?

2009-04-24 Thread Juanjo Conti
Does anyone tried both? Any comment? 2009/4/24 Juanjo Conti > Seems good! I'd like to contact the author but cound't find his mail > address. Can someone point it out? > > Thanks! > > 2009/4/22 Sergio Durand > > >> Hi, >> >> Visit swingtime project: >> http://code.google.com/p/django-swingtime/

Re: Django turns?

2009-04-24 Thread Juanjo Conti
Seems good! I'd like to contact the author but cound't find his mail address. Can someone point it out? Thanks! 2009/4/22 Sergio Durand > > Hi, > > Visit swingtime project: > http://code.google.com/p/django-swingtime/ > Maybe it's what you are looking for... > > -- > Sergio Durand > > Juanjo Co

providing extra info to the django.contrib.auth.views.password_change template

2009-04-24 Thread Ram
Hi Crew, I am using django.contrib.auth.views.password_change in my site thus: url(r'^passwordchange/$', 'django.contrib.auth.views.password_change', {'template_name': 'password_change.html'}, name='password_change'), I'm needing to pass some extra info to the templat

Re: Template Variables as Indexes

2009-04-24 Thread Doug B
Might not be the easiest way, but you could use a custom filter: def formsbyfield(forms,field): """ Given a list of similar forms, and a field name, return a list of formfields, one from each form. """ return [form.fields.get(field,'') for form in forms] register.filter('forms

Re: how to display m2m fields in template

2009-04-24 Thread Alex Gaynor
On Fri, Apr 24, 2009 at 7:18 PM, adrian wrote: > > > Given these models from the doc: > > class Publication(models.Model): >title = models.CharField(max_length=30) > > class Article(models.Model): >headline = models.CharField(max_length=100) >publications = models.ManyToManyField(Publ

Re: Offtopic: MySQL or PostgreSQL for a limited VPS ?

2009-04-24 Thread Joshua Partogi
On Apr 25, 8:20 am, Konstantin S wrote: > Hello! > > I am planning to deploy django based site on a limited VPS and want to > know which database is more suitable for this ? If I've had a 'normal' > hardware I'd vote for the PostgreSQL but maybe in case of limited > resources MySQL would be a b

how to display m2m fields in template

2009-04-24 Thread adrian
Given these models from the doc: class Publication(models.Model): title = models.CharField(max_length=30) class Article(models.Model): headline = models.CharField(max_length=100) publications = models.ManyToManyField(Publication) What do I need in the view and template to print an

Offtopic: MySQL or PostgreSQL for a limited VPS ?

2009-04-24 Thread Konstantin S
Hello! I am planning to deploy django based site on a limited VPS and want to know which database is more suitable for this ? If I've had a 'normal' hardware I'd vote for the PostgreSQL but maybe in case of limited resources MySQL would be a better choice. What do you think ? --~--~-~--~

Re: Is Django the Right Choice?

2009-04-24 Thread Rick Wagner
Hi John On Apr 24, 12:25 pm, John Crawford wrote: > > Django doesn't ship anything for XML serialization or deserialization,   > > but Python does. > > Actually, Django does provide that capability, at least in 1.0/1.1: > > http://docs.djangoproject.com/en/dev/topics/serialization/#topics-ser...

Re: simple model problem

2009-04-24 Thread Malcolm Tredinnick
On Fri, 2009-04-24 at 13:21 -0700, bshaurette wrote: [...] > My preference would be just to add an 'id' column to the table, but > we're trying to keep db changes to a minimum (changing one means > changing the same table in at least a dozen more - not optimal, but it > is what it is). Without i

Re: simple model problem

2009-04-24 Thread bshaurette
Is it actually possible to define a primary key that is a concatenation of two fields? I'm working on a project to get the admin to work on top of a legacy db - it's an old db with a few, ahem, design problems. For the most part I've been able to get around the bad structure with a few simple mo

Re: Is Django the Right Choice?

2009-04-24 Thread John Crawford
> Django doesn't ship anything for XML serialization or deserialization,   > but Python does. Actually, Django does provide that capability, at least in 1.0/1.1: http://docs.djangoproject.com/en/dev/topics/serialization/#topics-serialization Supported formats include XML, JSON (via simplejson),

Re: mysite.polls: __init__() got an unexpected keyword argument 'max_length'

2009-04-24 Thread Karen Tracey
On Fri, Apr 24, 2009 at 1:43 PM, bconnors wrote: > > i eliminated the field in Poll question = models.CharField > (max_length=200) and Choice choice = models.CharField(max_length=200) > and the error went away > Sure, but eliminating use of CharFields (plus, as you hit errors, every other thing

Re: force querset to update m2m field from database?

2009-04-24 Thread snorkel
doh I know what it was in my editA fnct I used a.form.save() a.new_element.add(new_element) but it need to be a=A.objects.get(pk=1) On Apr 24, 7:27 pm, snorkel wrote: > Hi, > > I have a tiny class called NewElement which only has one field (as > below) I don't want to use anot

ManyToMany relationship being 'lost'?

2009-04-24 Thread Rubens Altimari
Hello, Sorry if this is a known issue, but I didn't find anything elsewhere. I have these two models related by a many-to-many relationship. I'm using the 'default' admin application to edit data, and in order to be able to edit both sides of the relationship, I'm using the snippet provided by pow

Re: Decimal to Decimal nightmare

2009-04-24 Thread soniiic
Are you sure you're using it correctly? i googled it and came up with this which is the exact same position you're in. This never actually applies a value to be converted but it still tries and that's what causes the error (i think) >>> import decimal >>> d = decimal.Decimal() >>> reload(decimal

force querset to update m2m field from database?

2009-04-24 Thread snorkel
Hi, I have a tiny class called NewElement which only has one field (as below) I don't want to use another form to populate a field that only has one optional field ( especially since you seem to need two submit buttons?) Anyway it all works fine except that if you add the extra element (field) it

Re: mysite.polls: __init__() got an unexpected keyword argument 'max_length'

2009-04-24 Thread bconnors
i eliminated the field in Poll question = models.CharField (max_length=200) and Choice choice = models.CharField(max_length=200) and the error went away On Apr 24, 11:35 am, bconnors wrote: > I get: > > Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) > [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on li

Re: Is Django the Right Choice?

2009-04-24 Thread Rick Wagner
On Apr 24, 9:12 am, Masklinn wrote: > On 24 Apr 2009, at 16:24 , Carmine wrote: > > > On Fri, Apr 24, 2009 at 2:41 PM, Masklinn   > > wrote: > > >> On 24 Apr 2009, at 10:55 , earcar wrote: > >>> 1. does Django support REST queries? > >> I fear that question doesn't make any sense, REST is an a

Re: project design question

2009-04-24 Thread Jashugan
Unless things have changed, Django only supports one database connection at a time. So, you should put them all in one database. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

project design question

2009-04-24 Thread nixon66
I have several database that I want to use in a project and my question is should I put the all the database tables in one database so its easier for the settings.py file or should each database be separate. I'm using Mysql as a backend. So I would create one database called projects with everythi

Re: mysite.polls: __init__() got an unexpected keyword argument 'max_length'

2009-04-24 Thread Karen Tracey
On Fri, Apr 24, 2009 at 11:35 AM, bconnors wrote: > > I get: > > > Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) > [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import django > >>> django.__file__ > '/var/lib/python

Template Variables as Indexes

2009-04-24 Thread NewSpire
I have a list of forms, all of the same type, where I would like to list each form side by side with the fields listed vertically. The root of the problem is that I need to use a template variable as an index on another template variable. Something like this. {% for field in forms.0 %} {{

Re: Is Django the Right Choice?

2009-04-24 Thread Masklinn
On 24 Apr 2009, at 16:24 , Carmine wrote: > On Fri, Apr 24, 2009 at 2:41 PM, Masklinn > wrote: >> >> On 24 Apr 2009, at 10:55 , earcar wrote: >>> 1. does Django support REST queries? >> I fear that question doesn't make any sense, REST is an architectural >> style, not a language or anything, t

Re: Django beta slower with some queries?

2009-04-24 Thread Karen Tracey
On Fri, Apr 24, 2009 at 10:45 AM, julianb wrote: > > Hi, > > I have used Django 1.0.2 but moved to beta, because I badly needed > some new features. I want to "report" that I found some queries to > take considerably longer, while not having changed anything in the > code at all. I talk about a r

Re: Is Django the Right Choice?

2009-04-24 Thread Karen Tracey
On Fri, Apr 24, 2009 at 10:24 AM, Carmine wrote: > > On Fri, Apr 24, 2009 at 2:41 PM, Masklinn wrote: > >> 2. is possible to do a Django application without db? Are there any > >> ORM things that will do the same job for XML data instead? If not, is > >> possible to do that for mere mortals (wit

Re: mysite.polls: __init__() got an unexpected keyword argument 'max_length'

2009-04-24 Thread bconnors
I get: Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import django >>> django.__file__ '/var/lib/python-support/python2.5/django/__init__.pyc' >>> so i can go to that '/v

Re: mysite.polls: __init__() got an unexpected keyword argument 'max_length'

2009-04-24 Thread Brett Parker
On 24 Apr 06:28, bconnors wrote: > > I created a djsite folder and put new django there > > pubu...@pubuntu:~/djsite/mysite$ > + svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk > Checked out revision 10630. > pubu...@pubuntu:~/djsite/mysite$ > > then did > > pubu...@pubuntu

Decimal to Decimal nightmare

2009-04-24 Thread Newt
Hello, in my latest application I have models with like 15 Decimal fields, with different decimal places. when I try to save an object of that model, I get sometimes (often, but not always) this error: File "/home/newt/django/1.0/sites/cdms/item/views.py", line 1054, in item_copy object.s

Django beta slower with some queries?

2009-04-24 Thread julianb
Hi, I have used Django 1.0.2 but moved to beta, because I badly needed some new features. I want to "report" that I found some queries to take considerably longer, while not having changed anything in the code at all. I talk about a rather simple query, but one which involves some joins with tabl

Re: mysite.polls: __init__() got an unexpected keyword argument 'max_length'

2009-04-24 Thread Karen Tracey
On Fri, Apr 24, 2009 at 10:16 AM, bconnors wrote: > > How do I find out where the Django version 0.96.1 error message--even > though in the directory I’m working in has Checked out revision 10630, > is coming from? >From a python shell, import django and see where it's coming from. For example

Re: Is Django the Right Choice?

2009-04-24 Thread Carmine
On Fri, Apr 24, 2009 at 2:41 PM, Masklinn wrote: > > On 24 Apr 2009, at 10:55 , earcar wrote: >> 1. does Django support REST queries? > I fear that question doesn't make any sense, REST is an architectural > style, not a language or anything, there are no "REST queries". > > Other than that, yes

unassigned variable use in db/models/sql/query.py (wingware ide raised exception)

2009-04-24 Thread falken
hi, anyone using latest Wingware IDE with django-trunk any Python 2.5.1? runserver starts fine, but first app query discloses unassigned "int_alias" variable (this my quick patch works http://dpaste.com/37386/, but then still IMHO, int_alias will be never cleared - cannot be bigger trouble somewhe

Re: urlconf {{ app }}/{{ view }}

2009-04-24 Thread Alex Gaynor
On Fri, Apr 24, 2009 at 10:18 AM, Thierry wrote: > > what if u want to have an urlconf as such > /{{ app }}/{{ view }}/ > > so without specifying the view, it will dynamically load the app with > the variable input and the view...? > > > No, django doesn't enforce any type of convention on the typ

urlconf {{ app }}/{{ view }}

2009-04-24 Thread Thierry
what if u want to have an urlconf as such /{{ app }}/{{ view }}/ so without specifying the view, it will dynamically load the app with the variable input and the view...? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

Re: mysite.polls: __init__() got an unexpected keyword argument 'max_length'

2009-04-24 Thread bconnors
How do I find out where the Django version 0.96.1 error message--even though in the directory I’m working in has Checked out revision 10630, is coming from? I did find / -name site-packages -print and got : /usr/lib/python2.5/site-packages /usr/lib/python2.4/site-packages /usr/lib/python2.3/si

Configuration issues - /admin resolves but contains errors

2009-04-24 Thread Kristian R. Van Tassell
I recently switched from a mostly happy apache/mod_python/django implementation to mod_wsgi. Now, when I go to http://127.0.0.1 I get an error saying: Page not found (404) Request Method: GET Request URL: http://127.0.0.1/ Using the URLconf defined in contenta.urls, Django tried these URL patter

Re: mysite.polls: __init__() got an unexpected keyword argument 'max_length'

2009-04-24 Thread Daniel Roseman
On Apr 24, 2:28 pm, bconnors wrote: > I created a djsite folder and put new django there > > pubu...@pubuntu:~/djsite/mysite$ > + svn cohttp://code.djangoproject.com/svn/django/trunk/django-trunk > Checked out revision 10630. > pubu...@pubuntu:~/djsite/mysite$ > > then did > > pubu...@pubuntu:~/d

Re: mysite.polls: __init__() got an unexpected keyword argument 'max_length'

2009-04-24 Thread bconnors
I created a djsite folder and put new django there pubu...@pubuntu:~/djsite/mysite$ + svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk Checked out revision 10630. pubu...@pubuntu:~/djsite/mysite$ then did pubu...@pubuntu:~/djsite/mysite$ python manage.py runserver Validating

Re: Django on Google app engine

2009-04-24 Thread Karen Tracey
On Fri, Apr 24, 2009 at 5:06 AM, kRON wrote: > Google App Engine Django has been developed by Django employees. Typo correction -- Google employees are contributors to this project. The Django project doesn't have a company that employs people. Karen --~--~-~--~~~---

Re: Is Django the Right Choice?

2009-04-24 Thread Masklinn
On 24 Apr 2009, at 10:55 , earcar wrote: > 1. We already have the URLs and XSDs for the REST interface, but the > first are quite different from a correct REST implementation (no GET / > person, but GET /getperson, and so on). Sooo... it's absolutely not REST, it's RPC. > So the questions are: >

Is Django the Right Choice?

2009-04-24 Thread earcar
We are a group of developers that are about to start a project and so we are searching for the best tools and languages for the job. The project is essentially a "server" web application that holds data in XML, and answer to queries on that data through a REST interface, and a "client" web applica

how to handle database down time gracefully?

2009-04-24 Thread realfun
Hi, I build a website(fayaa.com) on Bluehost using Django, but this month database down 3 times, during that period, user can only see an "Unexpected Exception" message, is there a way to redirect to a 404 page instead? Regards, -realfun --~--~-~--~~~---~--~~ You

Re: New site: www.portaltotheuniverse.org

2009-04-24 Thread Christian Berg
Wow! Please post the site to http://www.djangosites.org/ This Site is so cool! I'm happy that the ESA puts so much efford in public Education. Im also happy that you have chosen Django for your project. This really proves that Django is the right choice for professional Websites. with best

Re: Export to excel sheet in djanogo using pagination

2009-04-24 Thread Tim Chase
> I have many pages to be exported to the excel sheet. I use django and > javascript. > i use pagination. Can any one help me out ? Just create a custom view that returns apropos content/headers. There are several ways of exporting files that Excel can read. CSV files: == +easy to make

Re: Django on Google app engine

2009-04-24 Thread kRON
Basically, you can't use Django models on Google App Engine. So, in brief, all Django applications that interact with a datastore will not work on Google App Engine. But - don't despair. There are two Django distributions ported for Google App Engine that I'm aware of: - http://code.google.com/p

Re: Select in a ModelForm

2009-04-24 Thread gontran
Thank you for your quick answer. It works fine now. On 24 avr, 10:13, "wrzymar Gazeta.pl" wrote: > Hello, > > Add co class Town function __unicode__ > > class Town(models.Model): >       id_town = models.AutoField(primary_key=True) >       name = models.CharField(max_length=30) > >       def __u

Re: New site: www.portaltotheuniverse.org

2009-04-24 Thread Gath
This is i darn so coo l!!! Man you guys are killing me with this stuff... This is such a coincidence; - Am i django developer - i love it - and am a fanatic of Astronomy... so i get to learn both topics which are so dear to my heart, all in ONE portal i have no words ... thanks. Gath On Apr 23,

Re: Select in a ModelForm

2009-04-24 Thread wrzymar Gazeta.pl
Hello, Add co class Town function __unicode__ class Town(models.Model): id_town = models.AutoField(primary_key=True) name = models.CharField(max_length=30) def __unicode__(self): return self.name 2009/4/24 gontran > > Hello, > > I have a problem with a select in a

Select in a ModelForm

2009-04-24 Thread gontran
Hello, I have a problem with a select in a ModelForm. My model: class Person(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) id_town = foreignyKey(Town) class Town(models.Model): id_town = models.AutoField(primary_key=True)

Re: rude, curt, and impatient, or direct, cut-through-the-B.S. communications

2009-04-24 Thread Russell Keith-Magee
On Fri, Apr 24, 2009 at 1:16 PM, Phil Mocek wrote: > > On Fri, Apr 24, 2009 at 10:46:46AM +0800, Russell Keith-Magee wrote: >> 2) If you would stop changing the subject line of discussions every >> time you respond, that would be just dandy, too. Rapid-fire subject >> changes don't help anyone k

Django on Google app engine

2009-04-24 Thread Joshua Partogi
Hi all, I came accross this article: http://code.google.com/appengine/articles/django.html Which made me interested how far can you go with django on app engine? Because reading that article there are several things that you must turn off from the django configs namely session & database. Are we