Antw.: How to edit form filling it with actual data

2012-06-05 Thread Hendrik Speidel
Hi Lucas, Try moving the first novo=... Right after if request.method Then dedent the else and the line following it (the second novo) Then remove request.POST from the second novo Explanation: If the request method is not POST this will instanciate an unbound form that loads the data from the

Re: Antw.: How to edit form filling it with actual data

2012-06-06 Thread Hendrik Speidel
t;> Hi Hendrik, I did what you said but I got an error because the variable "novo" is referenced before it's assignment. My html of this view is: {% csrf_token %} {{ novo.as_p }} 2012/6/5 Hendrik Spei

Re:

2012-06-06 Thread Hendrik Speidel
Hi, it seems that mysqldb is not installed. Try installing python-mysqldb using apt. If you are using a virtualenv then try this: http://www.saltycrane.com/blog/2010/02/install-mysqldb-virtualenv-ubuntu-karmic/ Good luck! hendrik On 06/06/2012 09:56 PM, vinoth kumar renganathan wrote: hi wh

Re: Django session and Dojo dnd.

2012-06-07 Thread Hendrik Speidel
and send this array to your django view (assumed to be at '/save_details/') - in the view, access the list as json.loads(request.POST.get('details', '[]')) and place it into request.session As m

Re: Django session and Dojo dnd.

2012-06-07 Thread Hendrik Speidel
dropped node), put the detail of each node in the details array. - then json-encode and send this array to your django view (assumed to be at '/save_details/') - in the view, access the li

Re: What the difference of django 1.4 runserver with mod_wsgi?

2012-06-09 Thread Hendrik Speidel
Hi, manage.py runserver is an embedded webserver for development and debugging purposes only. Do not use it in production! Use mod_wsgi, uwsgi, gunicorn or sth. for production. See: https://docs.djangoproject.com/en/dev/howto/deployment/ hendrik On 06/09/2012 05:18 PM, Raitucarp wrote: So,

Re: Is there anything like 'static' templates

2012-06-09 Thread Hendrik Speidel
Hi, have a look at django-staticgenerator. The original URL is no longer valid, but there is a fork here (but also quite old): https://github.com/timetric/django-staticgenerator* *i hope that helps * *hendrik * *On 06/09/2012 04:06 PM, Gelonida N wrote: Hi, This is mostly out of curiousity.

Re: Migration error

2012-06-10 Thread Hendrik Speidel
Hi Raitucarp, you can use the convert_to_south command to convert an existing app (with existing database tables) to south. In your case a manage.py migrate ngobrol 0001 --fake followed by a "manage.py migrate ngobrol" should fix your issue (given that you ran south initially, before changin

Re: Migration error

2012-06-10 Thread Hendrik Speidel
Hi again, can you verify that there are two migration scripts in your migrations folder? if yes, did you run manage.py migrate after the initial fake migration? if not, i speculate, that you ran south only after you already changed the models to include the aa column. South needs to know the i

Re: 'ascii' codec can't encode character u'\xe4'

2012-06-14 Thread Hendrik Speidel
Hi, as an alternative you can provide your own Storage implementation like outlined here: http://source.mihelac.org/2011/02/6/rename-uploaded-files-ascii-character-set-django/ Note: you may also need to override get_available_name to get it working if i remember correctly. hendrik On 06/14/20

Re: Some questions about uploaded file

2012-10-11 Thread Hendrik Speidel
Hi, django uses upload handlers to manage uploaded files. In the default configuration, if the uploaded file is small, it is only stored in memory at that point. Therefore, the uploaded file object does not expose a temporary path as part of its public api. When using a FileField/ImageField as par

Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2013-03-14 Thread Hendrik Speidel
Hi, Accessing the request within models may be problematic ... E.g. when using a management command, there is no request. However, it's doable: -implement a middleware that takes the request or request.user and stores it in a thread local -register this middleware in your settings -in your mod