Re: Need some help with form implementation.

2008-06-24 Thread Alex Slesarev
Hello! > I know I shall need a lot of javascript magic.. any hints as to go > about the django forms, fields and javascript stuff would be much > appreciated. You can use jQuery magic. Redefine admin's change_form template for required model (it should be located at path templates/admin// /chang

Re: Need some help with form implementation.

2008-06-24 Thread Alex Slesarev
Hello! > I know I shall need a lot of javascript magic.. any hints as to go > about the django forms, fields and javascript stuff would be much > appreciated. You can use jQuery magic. You have to redefine admin change form template for your model (this file should be named as templates/admin/ /

Re: Regression tests and TestCase method

2008-06-24 Thread Alex Slesarev
Hello! > I guess that the test runner tries to call "test_bla()" automatically. > How can I prevent that? Is it possible to move tast_bla() method to other class? You can create an instance of this class in the setUp() method of SomeTest and use it in all test cases. --~--~-~--~~

Re: error in starting app

2008-06-24 Thread Alex Slesarev
Hello! > I am at the stage > > << > It worked! > Congratulations on your first Django-powered page. How did you start site? python manage.py runserver? > I then issue the command > > python manage.py startapp books If "python manage.py runserver" command is worked, then "startapp" command also

Re: Django custom middleware question

2008-06-25 Thread Alex Slesarev
> How can I add an attribute or variable? to the request object in > middleware, where I can use it in other views via the request object. You can use threading.local() variables, like this: import threading _thread_locals = threading.local() def get_current_user(): return getattr(_thr

Re: Damn unicode error

2008-06-25 Thread Alex Slesarev
Difficult to say there is the error exactly, but I can give few hints to avoid this error: 1. Define __unicode__() function for all your models, like this: class BookCategory(models.Model): shortname = models.CharField(max_length = 765, verbose_name = _('short

Re: Some Model SQLite3 related questions/problems

2008-06-25 Thread Alex Slesarev
> Syncdb only does the initial table creation, it does note handle renaming, > adding, or deleting columns.  What you want is sometimes called "schema > migration" or "evolution".  Search this list and/or Google for pointers to a > few different external projects that are working on providing thi

Re: User Templates

2008-06-25 Thread Alex Slesarev
> I am looking for a way to enable users to make template to control the > presentation of reports that they would require. I am looking for the > most flexible to them and most secure to me way to do this. I want to > be careful since the data serve would come from my domain and thus be > vulnera

Re: django naming conventions ?

2008-06-25 Thread Alex Slesarev
http://www.djangoproject.com/documentation/contributing/ See "Coding Style" section. --~--~-~--~~~---~--~~ 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@googlegroup

Re: Problems retrieving array from POST

2008-06-26 Thread Alex Slesarev
> def post_handler(request): >     post_text = request.POST.getlist('data') >     user = User.objects.get(id=2) # for debugging purposes >     for x in range( len(post_text)-1 ): >         name = post_text[x] >         panel = > user.panels_set.get(name__istartswith=name,side="left") >         pan

Re: site_media paths

2008-06-26 Thread Alex Slesarev
> All my static files (css, js and so forth) live under a folder called > media Rename the directory - mod_python uses 'media' dir from django itself. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: Problems retrieving array from POST

2008-06-27 Thread Alex Slesarev
> How would I use 'print post_text'? I'd have to do it in the > interactive shell, in which case, how would I replicate > request.POST...? Just insert it to the 'post_handler' function and see results in console (of course, application should be started in console with 'manage.py runserver'). --~

Re: default user authentication, and session timeout

2008-06-27 Thread Alex Slesarev
On Jun 28, 1:13 am, hyde <[EMAIL PROTECTED]> wrote: > How to control the session timeout value if using Django's default > user authentication? Look in django docs (available in svn trunk). You should set SESSION_COOKIE_AGE variable (in seconds) in the settings.py file. --~--~-~--~~--

Re: Using SQLite in production

2008-07-03 Thread Alex Slesarev
One more issue - if you change a model, then you have to drop database and recreate it using syncdb (sqlite do not allow modifying tables and columns). It is not so good for production use. -- Best regards, Alex Slesarev. --~--~-~--~~~---~--~~ You received this

Re: Editing content in Django Admin change-list

2008-07-03 Thread Alex Slesarev
You can change required admin templates and tags. Though it is not so difficult, it is not so good, because it will touch ALL applications and models. Malcolm is right - better to create own custom page, see http://new.djangobook.com/en/1.0/chapter17/ -- Best regards, Alex Slesarev