Re: Using custom form class for the django.contrib.auth password_change view

2009-07-05 Thread Alex S.
After reading a bit in the source code I remembered that django apps don't use any magic and after that found the (easy) solution. Just extend your own class from the auth form PasswordChangeForm, use for example the "clean" method in your new form and write your own view for it. The password_chan

Re: using modelformsets

2009-07-05 Thread Matthias Kestenholz
Hi, On Sun, Jul 5, 2009 at 11:42 PM, Eric Abrahamsen wrote: > > I'm somehow failing to use modelformsets, this is the relevant view > and error traceback: > > http://dpaste.org/evHq/ > > I'm validating a whole bunch of forms at the same time, but I don't > see how that could cause the formset fai

Re: syncdb is not doing anything

2009-07-05 Thread Luc Saffre
I often got confused because when a modification in my models.py causes it to raise an ImportError (for example you try to import a non-existing module from your module.py), then several parts of Django (including syncdb) simply act as if your application wasn't installed, without any warning. May

Re: syncdb is not doing anything

2009-07-05 Thread Kenneth Gonsalves
On Monday 06 July 2009 10:47:59 chefsmart wrote: > have a lot of data in the database. Today I modified a couple of > fields and added a couple of fields (date and char fields) to three of > my models. No fields have been removed from the original model > definitions. syncdb does not look at cha

syncdb is not doing anything

2009-07-05 Thread chefsmart
Hi, I have been working on an app for some time now. I have been using the Django svn trunk. I have a lot of data in the database. Today I modified a couple of fields and added a couple of fields (date and char fields) to three of my models. No fields have been removed from the original model de

syncdb is not doing anything

2009-07-05 Thread chefsmart
Hi, I have been working on an app for some time now. I have been using the Django svn trunk. I have a lot of data in the database. Today I modified a couple of fields and added a couple of fields (date and char fields) to three of my models. No fields have been removed from the original model de

Re: Apache with Django

2009-07-05 Thread Boštjan Jerko
On 6.7.2009, at 5:31, WilsonOfCanada wrote: > > Also, do I use the my LAN IP or Internet IP with which port (is it the > same one Apache listens to)? > It depends how you set up the connection between Apache and Django? What do you use? Usually it's just a local server IP (so 127.0.0.1). B.

Re: Apache with Django

2009-07-05 Thread Kenneth Gonsalves
On Monday 06 July 2009 09:01:53 WilsonOfCanada wrote: > When running a production server, I was wondering if I still use > "python manage.py runserver [ip]:[port]" because the cmd says it is > running a development server. > > Also, do I use the my LAN IP or Internet IP with which port (is it the

Apache with Django

2009-07-05 Thread WilsonOfCanada
Hellos, When running a production server, I was wondering if I still use "python manage.py runserver [ip]:[port]" because the cmd says it is running a development server. Also, do I use the my LAN IP or Internet IP with which port (is it the same one Apache listens to)? Thanks --~--~-~

Re: Model for "Global Options"

2009-07-05 Thread dvainsencher
On Jul 5, 9:21 pm, dvainsencher wrote: > On Jul 5, 10:12 am, thornomad wrote: > > > > > Hi Daniel - > > > Okay ... so, it looks like I could do this two ways (maybe more). > > After reading:http://docs.djangoproject.com/en/dev/ref/templates/api/ > > > 1. I could create my own context process and

Re: Model for "Global Options"

2009-07-05 Thread dvainsencher
On Jul 5, 10:12 am, thornomad wrote: > Hi Daniel - > > Okay ... so, it looks like I could do this two ways (maybe more). > After reading:http://docs.djangoproject.com/en/dev/ref/templates/api/ > > 1. I could create my own context process and define it in > TEMPLATE_CONTEXT_PROCESSORS - > > 2. (ma

Re: problem with manage.py runfcgi and the pidfile parameter

2009-07-05 Thread aaron smith
Just as another illustration of the problem. I'm using the example in the help docs for the runfcgi command - even that doesn't work. $>python manage.py runfcgi socket=/tmp/fcgi.sock method=prefork daemonize=true pidfile=/var/run/django-fcgi.pid It doesn't write out the pid file, and it doesn't

problem with manage.py runfcgi and the pidfile parameter

2009-07-05 Thread aaron smith
Hey all, I'm running into something that I'm not sure if it's a problem, or something I might be doing wrong. What I'm working on is some deployment scripting, and using pid files to kill processes. I'm having problems with the pidfile attribute. When I run manage.py like this, the pidfile is wri

using modelformsets

2009-07-05 Thread Eric Abrahamsen
I'm somehow failing to use modelformsets, this is the relevant view and error traceback: http://dpaste.org/evHq/ I'm validating a whole bunch of forms at the same time, but I don't see how that could cause the formset failure. Sample is a model with a ForeignKey to Author (though the Forei

user passes test or is owner

2009-07-05 Thread Streamweaver
I'm new to decorators but using them in their basic form fine in Django so far. My problem is this. I have two model edit forms, each has an owner field that is a FK to a user. I also have some groups with permissions to edit the models. What I want to do is setup a 'is_owner_or_has_perm' deco

Admin of an Admin for an E-Commerce Page

2009-07-05 Thread Nick
I'm looking to write an e-commerce page with very minimal admin functionality, but which also has an extended admin that would facilitate the rest of the basic admin tasks. For example, the basic admin could add products but shouldn't have to know any html or meta- language to do so. They just i

Re: ChoiceField, TypedChoiceField, ModelChoiceField and empty_label

2009-07-05 Thread zweb
I also agree this is a needed feature. On Jul 3, 5:17 pm, maplye wrote: > I also agree that > > 2009/7/3 ristretto.rb : > > > > > Hello, > > > I have stepped through code, and cruised the django docs, forums, and > > internet in general looking for how to setup an empty label with > > TypedChoic

Re: extracting MySQL-python-1.2.3c1.tar.gz

2009-07-05 Thread Nikola Pavlović
On Sun, Jul 05, 2009 at 06:47:10AM -0700, mikel wrote: > > Setting up Django is going fine until configuring MySQL. It requires > MySQLdb, which I downloaded from sourceforge as MySQL- > python-1.2.3c1.tar.gz (and MySQL-python-1.2.2.tar.gz) on Mac OS X, > Redhat, and Windows. When I try decompres

Re: Using a dynamically created ImageField filename prior to save?

2009-07-05 Thread Mirat Can Bayrak
I have another question. You are naming images as hash of random number. There is a small chance to produce same name i think. It is not good way to give name ha? -- Mirat Can Bayrak --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Problem with Reverse

2009-07-05 Thread Karen Tracey
On Sat, Jul 4, 2009 at 11:44 PM, tam...@gmail.com wrote: > > Hi, > > I am trying to decouple my views.py with respect to my url.py but I > have a problem. > > -I do have a principal url.py which contains and include to a second > url.py: > urlpatterns = patterns('', > (r'^users/', include('myapp.

Re: Using email as username for django auth

2009-07-05 Thread Michael
On Sat, Jul 4, 2009 at 8:09 PM, zweb wrote: > > i just increased the size of username in auth_user table to 100 and I > enter email as user name from my register user web page. > Just for the record this is unsupported in Django (due to the constaints django.contrib.auth.models.User.username), a

Re: Easy way to include Request Context always?

2009-07-05 Thread Streamweaver
Thanks for the reply. I thought that might be the case but wanted to check. There is a very good blogpost about this very topic at Liconln Loop http://lincolnloop.com/blog/2008/may/10/getting-requestcontext-your-templates/ but it was made last year and I hoped there was a setting we could chan

Django and its caching system help

2009-07-05 Thread Ryan K
Greetings, I am designing an application that includes a menu with a many to many relationship with links. These menus will hardly ever change. What is the best way to cache these pages? Should I use the messaging system to create an html file to use when the menu is changed? Is database access q

Re: Global custom tags

2009-07-05 Thread diogobaeder
Thanks, Yu, it was a lack of attention of mine, not just a typo... I corrected the file name, now the module is being found, thanks! :-) Diogo On Jul 5, 6:32 am, Ronghui Yu wrote: > _init_.py should be > > __init__.py > > or just a typo error in the mail? > > diogobaeder ??: > > > > > Koen, >

Re: Problem displaying application data

2009-07-05 Thread Robert
I ran into a similar problem. It was solved when I corrected the indentation of "class admin" in models.py of the app. Cheers. Robert On 18 Jun, 18:49, Francis wrote: > Hi, > > In my project, theadmininterface is not able to display tables > content of one application. The other application ta

Re: Efficiency of getting attribute values in templates

2009-07-05 Thread Rajesh D
On Jul 4, 9:28 pm, TechnicalBard wrote: > But the admin app does - it defines the labels from the attribute > names and just puts them all in a table or list. > > How does one do that? Actually, you tell it which fields you want to display through the list_display attribute on your Admin class

Re: Django and chat

2009-07-05 Thread Juanjux (Google)
Hi Ivan, It's not based on Django, but it's easily embedable on any site and works pretty well: https://blueimp.net/ajax/ On Jul 3, 8:20 am, Ivan Uemlianin wrote: > Xiong > > Thanks for your comment.  Good questions. > > I envisage a social networking website, based on Django.  The website > w

extracting MySQL-python-1.2.3c1.tar.gz

2009-07-05 Thread mikel
Setting up Django is going fine until configuring MySQL. It requires MySQLdb, which I downloaded from sourceforge as MySQL- python-1.2.3c1.tar.gz (and MySQL-python-1.2.2.tar.gz) on Mac OS X, Redhat, and Windows. When I try decompressing then extracting the file returns error: "tar: This does not l

Re: Django and chat

2009-07-05 Thread Juanjux (Google)
Not Django, but it can be easily integrated on any site: https://blueimp.net/ajax/ On Jul 3, 8:20 am, Ivan Uemlianin wrote: > Xiong > > Thanks for your comment.  Good questions. > > I envisage a social networking website, based on Django.  The website > will provide a chat facility for users wh

Re: Model for "Global Options"

2009-07-05 Thread thornomad
Here is what I tried - is working. Not sure if it's as clever as it could be, but it works. # models.py class GlobalOptions(models.Model): key = models.SlugField(max_length=30,unique=True) value = models.TextField() # views.py def global_options(): dict = {} for go in GlobalOp

Re: Model for "Global Options"

2009-07-05 Thread thornomad
Hi Daniel - Okay ... so, it looks like I could do this two ways (maybe more). After reading: http://docs.djangoproject.com/en/dev/ref/templates/api/ 1. I could create my own context process and define it in TEMPLATE_CONTEXT_PROCESSORS - 2. (maybe more straightforward) I could create a function

Problem with mysql like operator with Django

2009-07-05 Thread newbie
Hi, In my view, I connected to the mysql server using the cursor object. I tried to execute the following query: select pincode from pincode where state='Andhra Pradesh' and district='Nellore' and area LIKE '%road%' or '%item%'; The above query is perfectly working when i give it on the mysq

Re: Global custom tags

2009-07-05 Thread Ronghui Yu
_init_.py should be __init__.py or just a typo error in the mail? diogobaeder ??: > Koen, > > I tried to make an initial template tag, just to test and learn, but > it's not working. I followed the instructions here > http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#howto-custom-

Re: Easy way to include Request Context always?

2009-07-05 Thread Ronghui Yu
I had the same problem. I didn't find a built-in way to solve this. But I think you can implement a custom render_to_response, which calls the built-in one in turn. Then what you need to do is just importing your custome one. Streamweaver ??: > I'm still struggling a bit with template contexts >

Problem with Reverse

2009-07-05 Thread tam...@gmail.com
Hi, I am trying to decouple my views.py with respect to my url.py but I have a problem. -I do have a principal url.py which contains and include to a second url.py: urlpatterns = patterns('', (r'^users/', include('myapp.users.urls')) . -Thus the second url.py contains: url(regex='^edit/(?P\

How do I display custom error messages to users?

2009-07-05 Thread Rex
There are situations on my site where I'd like to show the a page telling them what they did wrong: their browser doesn't support cookies, they erroneously try to re-submit a form, and so on. However, I want to be notified by email whenever a user encounters one of these errors, since I want to m