Re: textarea, max_length and \r\n

2010-06-25 Thread eka (Esteban)
By now I made my own TextAreaField that will replace('\r\n', '\n') in the to_python method On Jun 25, 11:34 pm, "eka (Esteban)" wrote: > Hi all > > I created a form with a textarea that has a max_length of 1024, this > textarea is rendered in frontend with a

genstatic - Generate and maintain static HTML files with Django templates

2010-06-25 Thread Aaron Maxwell
Hi all, Here is a GPLed software tool I made recently: http://github.com/redsymbol/genstatic Hope some of you find it useful and interesting. Please let me know if you have any feedback. Cheers, Aaron -- Aaron Maxwell http://redsymbol.net/ -- You received this message because you are

Re: Tutorial problems

2010-06-25 Thread Michael Schade
As Gabriel mentioned, make sure you reran the server after making the changes (though if using runserver, it should handle that for you). Also make sure you did not miss this bit in the tutorial: "Wait a minute. is, utterly, an unhelpful representation of this object. Let's fix that by editing

textarea, max_length and \r\n

2010-06-25 Thread eka (Esteban)
Hi all I created a form with a textarea that has a max_length of 1024, this textarea is rendered in frontend with a Javascript character counter, what is odd is that the counter was giving the right length, in this case 1024 and the form was failing in the max_length... debugging I came to see

Re: Tutorial problems

2010-06-25 Thread Gabriel Gayan
Have you tried re-running the server after saving the changes? the tutorial worked perfectly for me. On Fri, Jun 25, 2010 at 1:16 PM, zippzom wrote: > So, i'm working through the tutorial, but i'm having a problem with > the unicode method in the part 1 writing your own apps.

Re: Looking for unavailable table?

2010-06-25 Thread Mark Linsey
I don't quite understand what changes you made before producing this error, and I'm totally unfamiliar with sqllite. But I do know that for many (really, most) different model changes, just running syncdb will not make the appropriate changes to your tables. You probably need to look into south

Why is ModelAdmin to Model a 1-1 relationship?

2010-06-25 Thread patjenk
In our application, we have a Model that has a boolean field named "deleted". When the delete() method is called, we set the deleted field to 1 and then save the model. We would like to create an admin site where we can manage the deleted and non deleted instances separately. We could accomplish

Tutorial problems

2010-06-25 Thread Bradley Hintze
Hi all, I just installed Django using MacPorts on snow leopard and django-admin.py cannot be found anywhere on my computer, thus I cant do the tutorial. Also, the recommendation was given to place /opt/local/lib/python2.4/site-packages/django/bin in a $PATH but that given path is non-existant on

Re: Looking for unavailable table?

2010-06-25 Thread Oleg Lomaka
Actually it depends on your PYTHONPATH. syncdb scans all modules from INSTALLED_APPS looking for models.py in them to populate database. So if you access you Entity model (for example at views.py) as from directory.models import Entity then add 'directory' to INSTALLED_APPS. On Jun 26, 2010,

Re: Looking for unavailable table?

2010-06-25 Thread Jonathan Hayward
No; that sounds like the issue then? If my project directory is named "directory", and I want to access the "Entity" model in "models.py", what do I add to INSTALLED_APPS? I'm guessing something like "directory", but I briefly searched online and couldn't tell. On Fri, Jun 25, 2010 at 5:35 PM,

Re: Looking for unavailable table?

2010-06-25 Thread Oleg Lomaka
Did you add your application to INSTALLED_APPS before running syncdb? On Jun 26, 2010, at 12:09 AM, Jonathan Hayward wrote: > P.S. Renaming the (SQLite) database file and running syncdb again produces > (basically) the same behavior. I had to do some initialization things again, > but outside

Re: Looking for unavailable table?

2010-06-25 Thread Jonathan Hayward
P.S. Renaming the (SQLite) database file and running syncdb again produces (basically) the same behavior. I had to do some initialization things again, but outside of that I got equivalent behavior to what I pasted below. What I am trying to do is create a few instances of the Entity model

Looking for unavailable table?

2010-06-25 Thread Jonathan Hayward
I received the error below from the admin interface; I thought it was because I needed to run a syncdb, but stopping the server, running a syncdb, and restarting has generated the same error: OperationalError at /admin/directory/entity/ no such table: directory_entity Request Method:GETRequest

Change password form doesn't work in Admin page

2010-06-25 Thread Pedro I. Sanchez
Hello, When I visit the User change form in the admin pages I get a link under the password field that says: Use '[algo]$[salt]$[hexdigest]' or use the is a link to http://127.0.0.1:8000/admin/auth/user/6/password/ and when I click on it I get the error: "user object with primary key

Re: Rendering the Admin app list?

2010-06-25 Thread raj
> Before I "pass the variable app_list"; do I not need to create what is > in this variable first?  If so, how? That template is rendered by the view, AdminSite.index() found at django.contrib.admin.sites. Please Check it to know how it's done. Rajeesh. -- You received this message because

Re: Localized admin and date field formats

2010-06-25 Thread Jeliuc Alexandr
Yes, You are right it was this patch. On un 25, 3:36 pm, "Danny W. Adair" wrote: > Hi Alexander, > > On Jun 15, 9:54 am, Alexander Jeliuc wrote: > > > Thank You, I found a patch for that. My version is already 1.2.1 > > After pathching

manytomany relationships based on primary keys

2010-06-25 Thread thusjanthan
I have the following relationship between student and course: class Student(models.Model): crse_id = models.CharField(max_length=18,primary_key=True) crse_offer_nbr = models.IntegerField(primary_key=True) strm = models.CharField(max_length=12,primary_key=True) class_section =

Re: django csrf

2010-06-25 Thread thusjanthan
The quick answer is you have to put the following in your template right after the declaration: {% csrf_token %} Cheers, Nathan. On Jun 25, 2:48 am, Li Hui wrote: > When I add enctype="text/plain" to a post form like method="post" enctype="text/plain">, there is a "CSRF

Tutorial problems

2010-06-25 Thread zippzom
So, i'm working through the tutorial, but i'm having a problem with the unicode method in the part 1 writing your own apps. I've copied the code to the letter, but it still only returns instead . Any ideas why this could be happening? Sorry if this is the wrong place to post this. -- You

New project, debating postgresql or MySQL (Amazon RDS), does it matter to Django?

2010-06-25 Thread Eric Chamberlain
Hello, We have a new project and are debating whether to use postrgresql (Amazon EC2) or MySQL with InnoDB tables (Amazon RDS). It looks like our TCO would be much lower using Amazon RDS. Our past Django experience has been with postgresql, does MySQL InnoDB have any problems with Django's

Re: can't adapt type 'Decimal'

2010-06-25 Thread poupou
Yes I'm running two sites on the same server. Only difference with you is that I'm running it with virtual host. I modifier my Apache config, now it looks like this : ServerName site1.com WSGIDaemonProcess site1 WSGIScriptAlias / /var/www/site1.wsgi process-group=site1

list_editable and save changes to individual row/cell

2010-06-25 Thread Jason Wang
Hi all, Does anyone know if there is a way to save changes on a per row/cell basis for forms with list_editable in django admin? I would like to have a button for each row and each cell to do that. Thanks a lot! Jason -- You received this message because you are subscribed to the Google

Jaspersoft or Pentaho with Django?

2010-06-25 Thread zweb
Has anyone used Jaspersoft or Pentaho with DJango or Python in production? Are there any Python equivalent of Jaspersoft/Pentaho? Any experiences? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: generate localized message

2010-06-25 Thread Felippe Bueno
I think you need to install gettext package. On Fri, Jun 25, 2010 at 1:23 PM, Thomas Lionel Smets wrote: > My django application root directory on my Mac is : > /Users/tsmets/Documents/python// > Under that folder I have the following directory structure : > >

generate localized message

2010-06-25 Thread Thomas Lionel Smets
My django application root directory on my Mac is : /Users/tsmets/Documents/python// Under that folder I have the following directory structure : Thomas-SMETSs-MacBook-Pro: tsmets$ find . -d 1 ./.svn ./__init__.py ./Base ./clean_unused.sh ./constants.py ./fixtures ./formats ./Health

Re: can't adapt type 'Decimal'

2010-06-25 Thread Stuart
On Jun 25, 8:06 am, poupou wrote: > >   Of the 2 web site that I have, It only happens where I make request > using the the Q objects. > If you have two django sites/projects on the same server (e.g. http://myserver/app1 and http://myserver/app2) and you are using

Re: Using PostgreSQL Blob from Django

2010-06-25 Thread SlafS
Lately i found the django-storages app and DatabaseStorage[1] Haven't test it though. But using custom storage along with Django FileField seems like a good idea. Regards Sławek [1] http://code.welldev.org/django-storages/wiki/DatabaseStorage On 25 Cze, 04:26, Kenneth Gonsalves

Re: Admin Media output order?

2010-06-25 Thread ringemup
Hehe, I'm actually using a bastardized custom admin class to handle the actual display of the app list. It seems odd to me that there's no way to control the order in which admin media are output, since javascript is sensitive to the order in which it's specified. It means that in order to

Re: can't adapt type 'Decimal'

2010-06-25 Thread Stuart
On Jun 25, 8:06 am, poupou wrote: > >   Of the 2 web site that I have, It only happens where I make request > using the the Q objects. > Your problem sounds like the problem I just went through. I assume you are using mod_wsgi. Are the two sites on the same server? For

Re: Rendering the Admin app list?

2010-06-25 Thread derek
On Jun 25, 9:07 am, "euan.godd...@googlemail.com" wrote: > Do you mean that you want to include this code in your own app or want > to alter the structure of the admin app? > > Either of these actions will require the view that renders the page to > pass the variable

can't adapt type 'Decimal'

2010-06-25 Thread poupou
Hi, I'm getting the error "can't adapt type 'Decimal'" from time to time in my Django web site. Once I restart Apache it will works for few hours, then some users will start to get this error. Of the 2 web site that I have, It only happens where I make request using the the Q objects.

Re: django csrf

2010-06-25 Thread Tom Evans
On Fri, Jun 25, 2010 at 10:48 AM, Li Hui wrote: > When I add enctype="text/plain" to a post form like method="post" enctype="text/plain">, there is a "CSRF verification > failed." error. > But when I remove it, all is right. > Who can tell me why? > Because that is not how HTML

django csrf

2010-06-25 Thread Li Hui
When I add enctype="text/plain" to a post form like , there is a "CSRF verification failed." error. But when I remove it, all is right. Who can tell me why? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Localized admin and date field formats

2010-06-25 Thread Danny W. Adair
Hi Alexander, On Jun 15, 9:54 am, Alexander Jeliuc wrote: > Thank You, I found a patch for that. My version is already 1.2.1 > After pathching fields.py and widgets.py it start working fine It helps others if you mention where they can find such a patch. I assume it

Re: reloading in shell

2010-06-25 Thread euan.godd...@googlemail.com
LOL. Yeah bpython is interesting. Some of the features were pretty nice last time i tried it, but it was a bit flaky so I stuck with iPython. Could have well improved since then though. On Jun 25, 12:26 pm, Kenneth Gonsalves wrote: > On Friday 25 June 2010 16:48:49

Re: reloading in shell

2010-06-25 Thread Kenneth Gonsalves
On Friday 25 June 2010 16:48:49 euan.godd...@googlemail.com wrote: > > The latter, as I don't have to do at across 200 different boxes, I > > just edit one file in my NFS home directory? > > That was joke btw. But for one person running on a single machine with > plenty of resources, I honestly

Re: Deployment hesitation after James Bennett's post, WSGI or ...?

2010-06-25 Thread lzantal
On Jun 25, 2010, at 1:55, Dave E wrote: I'll certainly share my observations. I just did my first django deploy with nginx+fcgi with ssl and I have to say it was much easier to set it up and configure it than nginx +apache2+wsgi It also uses way less ram and CPU then

Re: reloading in shell

2010-06-25 Thread euan.godd...@googlemail.com
> The latter, as I don't have to do at across 200 different boxes, I > just edit one file in my NFS home directory? That was joke btw. But for one person running on a single machine with plenty of resources, I honestly think that iPython is the best option. I had a read of the link you posted and

Re: reloading in shell

2010-06-25 Thread Tom Evans
On Fri, Jun 25, 2010 at 11:55 AM, euan.godd...@googlemail.com wrote: >> To be a bit pedantic, python itself supports many of these features >> (tab completion, history) if you tell it to. > > What's easier, sudo easy_install iPython, or making alterations to the > existing

Re: reloading in shell

2010-06-25 Thread Kenneth Gonsalves
On Friday 25 June 2010 16:25:22 euan.godd...@googlemail.com wrote: > > To be a bit pedantic, python itself supports many of these features > > (tab completion, history) if you tell it to. > > What's easier, sudo easy_install iPython, or making alterations to the > existing python interpreter and

Re: reloading in shell

2010-06-25 Thread euan.godd...@googlemail.com
> To be a bit pedantic, python itself supports many of these features > (tab completion, history) if you tell it to. What's easier, sudo easy_install iPython, or making alterations to the existing python interpreter and still not having colour :) ? -- You received this message because you are

Re: Deployment hesitation after James Bennett's post, WSGI or ...?

2010-06-25 Thread Antoni Aloy
Hi, WSGI is the best option. For that we're using ngnix+cherrypy (just the wsgi adapter) and it works like a charm. Recently we've start testing gunicorn as well, as the deployment is really easy. This kind of configuration allows you to reduce drastically the memory consumption, so you can

Re: reloading in shell

2010-06-25 Thread Tom Evans
On Fri, Jun 25, 2010 at 4:13 AM, Shawn Milochik wrote: > Install ipython. > > It has a lot of great features, including retaining history. > > If it's installed, Django will use it by default if you run manage.py shell. > > Shawn > > Sent from my iPhone 4, for which I waited

Re: Deployment hesitation after James Bennett's post, WSGI or ...?

2010-06-25 Thread Dave E
I'll certainly share my observations. > I just did my first django deploy with nginx+fcgi with ssl and I have   > to say it was much easier to set it up and configure it than nginx > +apache2+wsgi > It also uses way less ram and CPU then the other deploy. Also I am   > using supervisord to manage

Re: Admin Media output order?

2010-06-25 Thread iliveinapark
Ha, I think I missed the point of that question... See the admin templates part of my answer, ignore the rest - I don't think it applies to your question, but it's a nifty trick anyways. Brenton. On Jun 25, 11:37 am, iliveinapark wrote: > Gday, > > Overriding the

Re: ModelChoiceField

2010-06-25 Thread Tran Cao Thai
Thank you very much. I missed that part in the documentation On Fri, Jun 25, 2010 at 4:54 PM, Oleg Lomaka wrote: > On 6/25/10 8:25 AM, Tran Cao Thai wrote: > >> is there any way to use the ModelChoiceField without any value in it? I >> tried to set query = None but it

Re: Admin Media output order?

2010-06-25 Thread euan.godd...@googlemail.com
You could possibly alter the metaclass for the media for your model, but I suspect this would lead to a whole world of hurt. On 24 June, 20:18, ringemup wrote: > Is there any way to change the order in which admin media are output > (e.g. outputting a ModelAdmin-level

Re: Rendering the Admin app list?

2010-06-25 Thread euan.godd...@googlemail.com
Do you mean that you want to include this code in your own app or want to alter the structure of the admin app? Either of these actions will require the view that renders the page to pass the variable app_list into the context as }% if app_list %} will always be False as Django's templating

Re: reloading in shell

2010-06-25 Thread euan.godd...@googlemail.com
iPython is great for this sort of thing, especially the code completion with tab. You could also use the reload statement. This only works when you do: import foo.bar.MyClass and doesn't always work correctly, but it might save a bit of typing. On 25 June, 06:24, Kenneth Gonsalves

Re: ModelChoiceField

2010-06-25 Thread Oleg Lomaka
On 6/25/10 8:25 AM, Tran Cao Thai wrote: is there any way to use the ModelChoiceField without any value in it? I tried to set query = None but it gave an error while rendering the html page Use EmptyQuerySet. field = ModelChoiceField(queryset=YouMode.objects.none())

Rendering the Admin app list?

2010-06-25 Thread derek
Working with Django 1.2.1 The default index page for Django admin contains: {% if app_list %} {% for app in app_list %} ... {% endfor %} {% else %} {% trans "You don't have permission to edit anything." %} {% endif %} I'd like to move this snippet to a separate page; however, when I