Re: Advanced Form Questions

2008-04-02 Thread Przemek Gawronski
For multiple instances of the same form you should use the 'prefix' parameter in the constructor: > .. > form = SearchForm(request.POST) f1 = SearchForm( prefix='f1', request=request.POST) f2 = SearchForm( prefix='f2', request=request.POST) .. or: FORMS_COUNT=3 forms=[ SearchForm(

Re: javascript in django

2008-03-29 Thread Przemek Gawronski
Dnia Fri, Mar 28, 2008 at 09:00:26AM -0700, [EMAIL PROTECTED] napisaƂ: > So if it was called "color" in your model, the field name would be > "id_foo" A mistype above, it would be: color -> id_color Przemek -- AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin info:

Re: ImageField: separating text field from button

2008-01-01 Thread Przemek Gawronski
> can you explain a bit clearly what you want to do? If I have a form (newform) with a ImageFiled (probably the same with a FileField) and in the template I use {{ form }} to display this form, the text field and the button you press to select a file are right next to each other, and I want some

ImageField: separating text field from button

2008-01-01 Thread Przemek Gawronski
Hi, I want to separate the file name text field from 'select' button in ImageField from newforms. What would be the cleanest way to do this? Przemek -- AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin info: http://tanren.pl/ phone:+4850151 mailto:[EMAIL PROTECTED]

Re: Problem get_FOO_url in development server

2007-10-29 Thread Przemek Gawronski
> Did you include the port in your MEDIA_URL setting? [1]_ > MEDIA_URL = 'http://localhost:8000/media/' Nope, thanks! Przemek -- AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin info: http://tanren.pl/ phone:+4850151 email:[EMAIL PROTECTED]

Problem get_FOO_url in development server

2007-10-29 Thread Przemek Gawronski
Hi, the ImageField creates in a model get_FOO_url to use in the templates. But it isn't working correctly when used with djangos development server because the port number (by default :8000) isn't included. Is that a bug or am I missing something? Przemek -- AIKIDO TANREN DOJO - Poland -

Re: Djangonauts in Amsterdam, Prague, or Krakow?

2007-10-21 Thread Przemek Gawronski
If you would 'jump' from Krakow to Warsaw then I'd be more then happy have a beer together. Przemek -- AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin info: http://tanren.pl/ phone:+4850151 email:[EMAIL PROTECTED]

[newforms] Confirming password widget

2007-10-15 Thread Przemek Gawronski
Hi, is there a password confirmation widget around, to automatically check and validate (with error messages) if it's the same or not with a password previously entered (in a different CharField)? If not, any guide lines on implementing would be nice :) Thanks Przemek -- AIKIDO TANREN DOJO -

Re: Redirect after login problem

2007-09-29 Thread Przemek Gawronski
Hi > I'm using the following code, anyone got any ideas what could be > wrong? > @login_required(redirect_field_name='/login/') My guess is, that it should be: @login_required(redirect_field_name='/hosting/login/') > urls.py > # Login > (r'^hosting/login/$',

Re: Two newform best practice questions

2007-09-26 Thread Przemek Gawronski
> Try this: >f1 = Form1(request.POST, prefix='form1') >f2 = Form2(request.POST, prefix='form2') > That should solve your problem. The prefix argument is prepended to > every field name in the html, thus preventing name clashes between > forms. That should be in the 0.96 release. No docs

Re: Two newform best practice questions

2007-09-26 Thread Przemek Gawronski
> Use form_for_model or form_for_instance using the fields argument. Make > one form object for each model with the field subset you'd like to use. > There's nothing stopping you from using several form objects in the same > html form. Just remember to validate them all. I'm using several forms

Re: Temporary access to link in django

2007-09-12 Thread Przemek Gawronski
> take 5 minutes out to create a temp user model and table You're suggesting to extend the User model? Something like: class TempUser(models.Model): user = models.ForeignKey(User) ... Przemek -- AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin info:

Re: Temporary access to link in django

2007-09-12 Thread Przemek Gawronski
> I think you may be complicating things unnecesarily by not creating a > user. Well, maybe that's why I'm asking for suggestions :) > Why not look at creating a temporary user group, and maybe adding an > additional check at login if this user is a temporary user, they > cannot login 1 month

Temporary access to link in django

2007-09-12 Thread Przemek Gawronski
Hi, I want to give a temporary access to link to a visitor but I don't want to create an user account for him but give access only to him. In general the scenario is to look more/less like this: 1 - visitor fills a form with some data, including an email field and a password, 2 - data from the

Re: ANN: Screencast - Learn Django: Create a Wiki in 20 minutes

2007-09-11 Thread Przemek Gawronski
Hi Siddhi > Well, I could have done it like that also. In many wikis, the special > pages are treated like normal page URLs but only that some special > action is taken, so I did it this way. Ok, now I understand. >> As for suggestions for next cast, I would be thankful for a cast where >> you

Re: Django and mod_proxy

2007-08-06 Thread Przemek Gawronski
> Is that running by runserver:8000? Yep! > Is your django dev server serving static files? Yes, django server is serving static files, in my urlpatterns = patterns('', (r'^js/(?P.*)$', 'django.views.static.serve',{'document_root': '/home/django/work/fw/media/'}), (r'^css/(?P.*)$',

Django and mod_proxy

2007-08-02 Thread Przemek Gawronski
Hi, I'm having some problems running Django behind an Apache with a mod_proxy. So my router transmits all it's communication on port 80 to 192.168.0.2, on which I've setup mod_proxy (with django server on 192.168.1.2, the networks see each other) ProxyRequests On ProxyPass /django/

Re: ANN: Screencast - Learn Django: Create a Wiki in 20 minutes

2007-07-26 Thread Przemek Gawronski
Thanks Siddhi, very clearly presented! Looking forward to see more, maybe with newforms? Przemek -- AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin info: http://www.tanren.pl/ phone: +4850151 email: [EMAIL PROTECTED]

Re: List with pagination, sorting and simple search interface

2007-07-25 Thread Przemek Gawronski
> Thanks. Finally I've used PaginatorPag from your link (with some > changes) and > Sortable Headers (from djangosnippets) with some changes too, newforms > to create search form and generic list. > Changes I had to do were necessary because each of those components - > sort, filter and

Re: Django's User authentication

2007-07-18 Thread Przemek Gawronski
> is this use for the django admin features only? or I can use it for my > own app? if yes, do I make it suitable for my application? Sure you can, tak a look at: http://www.djangoproject.com/documentation/authentication/#how-to-log-a-user-in Przemek -- AIKIDO TANREN DOJO - Poland - Warsaw

generic views and selection for foreignkey

2007-07-16 Thread Przemek Gawronski
Hi, in the model I've got: class Client(models.Model): name = models.CharField(maxlength=200) class Workorder(models.Model): client = models.ForeignKey(Client) name = models.CharField(maxlength=200) As for input I'm using generic views (create_update.create_object,..). How can I get

Re: Django + newforms + jQuery

2007-07-14 Thread Przemek Gawronski
> I'm assuming that you want to use some form a AJAX type request/response > for this? Well, once I'll feel comfortable with django and js, then probably, but not at the moment. > As an outline you might want to do something like this: > Display your list as a table > Use your workorder id

Re: JavaScript in template

2007-07-14 Thread Przemek Gawronski
Now that was quick! Big thanks! Przemek -- AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin info: http://www.tanren.pl/ phone: +4850151 email: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed

JavaScript in template

2007-07-14 Thread Przemek Gawronski
Hi, how do I specify the source of JS scripts in my templates? In my settings.py I've got: MEDIA_ROOT = '/home/django/work/fw/media/' MEDIA_URL = 'http://192.168.1.1' ADMIN_MEDIA_PREFIX = '/media/' In the template (base.html):

django on FreeBDS

2007-07-13 Thread Przemek Gawronski
Hi, a hosting company has installed django for me on their system (FreeBSD 6.2-RELEASE-p5). When I try to run (ssh under jailshell): 'django-admin.py startproject test' I get: Traceback (most recent call last): File "/usr/local/bin/django-admin.py", line 5, in ?

Re: Django + newforms + jQuery

2007-07-13 Thread Przemek Gawronski
> I have no idea what you're trying to do with your form, How about something like this: in my model I've got a class Workorder, with some info about it. For the Workorder there are time sheets, printouts and some other objects. I want to show to the user a list of workorders with the

Re: Django + newforms + jQuery

2007-07-12 Thread Przemek Gawronski
> This__ isn't interesting, but it *is* an example. :-) > .. __: http://groups.google.com/group/django-users/msg/c8f7d18eb79d9aa1 It's definitely a start, thanks! Przemek -- AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin info: http://www.tanren.pl/ phone: +4850151

Re: Django + newforms + jQuery

2007-07-12 Thread Przemek Gawronski
> I have no idea what you're trying to do with your form, but I've used > jquery and newforms together. Without knowing waht you're trying to > do, I can't give any specific advice or tips, but at the most basic > level, you just grab the element you want: $("#id_foo") and you're on > your way.

Re: Django + newforms + jQuery

2007-07-12 Thread Przemek Gawronski
> What do you mean? Perhaps you should go to the jQuery-EN group and > look for examples of form manipulation there. Thanks, I'll do that! Przemek -- AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin info: http://www.tanren.pl/ phone: +4850151 email: [EMAIL PROTECTED]

Django + newforms + jQuery

2007-07-12 Thread Przemek Gawronski
Hi, any one willing to share some examples of django newforms with jQuery? Thanks in advance! Przemek -- AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin info: http://www.tanren.pl/ phone: +4850151 email: [EMAIL PROTECTED]