[Announcement]: WebHelpers for Django

2007-06-05 Thread viestards

Greetings!

To boost my Django skills and show that Django can be JavaScript-ready
from the start, I started porting Pylons Webhelpers[1] to Django,
implementing them as templatetags.
It is hosted on Google projects[2]. To show how it works, I created
small Django project that implements basic Webhelpers features. You
can find it in project's Download section [3]

For starters I plan to port existing functions, but I have some ideas
what has to be done more.
Any suggestions and ideas welcome.

[1] http://pylonshq.com/WebHelpers/module-index.html
[2] http://code.google.com/p/django-helpers/
[3] http://django-helpers.googlecode.com/files/helpers.zip
-- 
Arvis
http://viestards.tosteris.com/

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Newforms example

2007-04-27 Thread viestards

I liked this tutorial:
http://code.pui.ch/2007/01/07/using-djangos-newforms/

try searching Google for 'django newforms tutorial', there is some
other good tutorials too


On 4/27/07, Gerry Steele <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've been building an app and all has been going well. I was though
> using the admin to do all input and editing of data. Now i'm trying to
> build forms for all this and i'm finding newforms docs to be no use to me.
>
> I went through all the docs at
> http://www.djangoproject.com/documentation/newforms/ and found it to not
> once mention how to handle submitting forms and the accompanying
> required view.py logic. Also there is no mention of where to put
> newforms, or how one should get a newforms model to the template.
>
> I was wondering if someone could perhaps post a fuller example so I
> could get a proper overview of how it all works or perhaps there is a
> tutorial someplace i'm unaware of.



> Many Thanks
> Gerry.
>
>
> >
>

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



syncdb through web interface

2006-11-08 Thread viestards

Because many hosting providers does not allow shell access, I decided
to create web version of syncdb. I made this simple function, and
looks like it works

def db_sync(request):
from django.core import management
management.syncdb()
return HttpResponse("Db sync in progress.")

Is it really so simple, or is there is something I'm missing besides
sys. messages?
If so maybe model creation interfacwe can be built?

--~--~-~--~~~---~--~~
 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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: date format other than YYYY-MM-DD

2006-09-29 Thread viestards

> I have a small function:

> I use the usual form stuff. But if I detect an error on the date field
> (Fecha in Spanish) I just throw the string to the previous function. If
> it doesn't raise an exception I use the return to build a sting that
> django will accept and call get_validation_errors again.
>
> It's not pretty, not very portable, prone to break when the main
> manipulator code/system change, but... well it's easy.
>
> Javier.

thanks, suppose I have to do it this way. I just hoped to have a
sollution that works in admin pages too.

Viestards

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: date format other than YYYY-MM-DD

2006-09-27 Thread viestards

> Using the 'date' filter, you can format the output however you want,
> within templates.
>
> For example, to format a date as "September 17, 2006", you would do
> the following in a template:
>
> {{ object.pub_date|date:"F d, Y" }}

thanks for reply, but will it work on forms?
 Right now I get:
'FormFieldWrapper' object has no attribute 'day'
and mark on line
{{form.registrationDate|date:"d.m.Y"}}

Viestards

> Jay P.

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



date format other than YYYY-MM-DD

2006-09-27 Thread viestards

Hi everyone!

As far as I know date format is hardcoded into Django as -MM-DD.
Is there any way to change it globally?
If not what is best way to change date format in forms to other? For
now, I change date format in view from dd.mm. but I doubt it's the
best way to do such things.

Viestards

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: [FastCGI] - I don't have permission....

2006-09-18 Thread viestards

> Forbidden
> "You don't have permission to access / on this server."

for me problem was in
RewriteRule ^/(.*)$ /mysite.fcgi/$1 [QSA,L]

i changed to
RewriteRule ^(.*)$ mysite.fcgi/$1 [L]
and it worked

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: How to use month/date/year menus for date?

2006-09-02 Thread viestards

> The question is, how can I get those three menus to create a single
> date object that plays nice with Django?
>

I think the easyest way will be to format selected day, month, year
with Javascript, but definetly not the best. May be write a custom
Validator.

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Django on shared hosting - no effect until restart SOLVED

2006-09-01 Thread viestards

Looks like I have to add to httpd.conf
FastCgiConfig -autoUpdate

http://www.fastcgi.com/docs/faq.html#application_reload

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django on shared hosting - no effect until restart

2006-08-31 Thread viestards

> With FCGI, do a touch on your .fcgi file. That always works for me.

I write "aaa" in fcgi file, which must cause syntax error, save it,
but nothing happens.

> Easier way of course is to develop with the built-in development
> server, and only start Apache when your development is done.

My hosting provider will not restart server every time when I need it.
Maybe it's fcgi fault, now default FreeBSD FastCGI package is used,
and it's built as DSO. Maybe I have to build it other way.

> Jay P.
>
> >
>

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Django on shared hosting - no effect until restart

2006-08-30 Thread viestards

I'm trying to setup shared Django hosting on FreeBSD with Apache, but
I have to restart Apache every time when I want changes to take
effect, insead of  simply touching file.
Calling FastCGI file directly have same results- no effect until restart.
Is this FastCGI problem or I have to look somewhere else?

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Problem setting up Apapche FastCGI and Django

2006-08-25 Thread viestards

problem solved, looks like I misspelled document path and process
coudn't find right file.

Viestards


On 8/25/06, viestards <[EMAIL PROTECTED]> wrote:
> > Did you actually started the fastcgi django process on port 3066?
>
> yes, I restarted manage.py runfcgi once again and it is on process list.
>
> Viestards
>
> > hth,
> > Edgars
> >
>

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Problem setting up Apapche FastCGI and Django

2006-08-25 Thread viestards

> Did you actually started the fastcgi django process on port 3066?

yes, I restarted manage.py runfcgi once again and it is on process list.

Viestards

> hth,
> Edgars
>

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Problem setting up Apapche FastCGI and Django

2006-08-25 Thread viestards

I'm stuck with setting up django on Apache 1.3.7 with FastCGI.
I', trying to follow Django documentation, but that does not seems to work

here is part from my httpd.conf

FastCGIExternalServer /usr/home/arvis/django/tst/mysite/site.fcgi
-host 127.0.0.1:3066


 ServerName testa.darba.info
DocumentRoot /home/arvis/django/tst/mysite
Alias /media /home/arvis/django_src/django/contrib/admin/media
RewriteEngine On
RewriteRule ^/(media.*)$ /$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ /site.fcgi/$1 [QSA,L]


httpd-error.log shows following:
[Mon Apr 17 01:10:43 2006] [notice] FastCGI: process manager
initialized (pid 3487)
[Mon Apr 17 01:10:43 2006] [notice] Apache/1.3.34 (Unix)
mod_fastcgi/2.4.2 configured -- resuming normal operations
[Mon Apr 17 01:10:43 2006] [notice] Accept mutex: flock (Default: flock)
[Mon Apr 17 01:10:53 2006] [error] [client 127.0.0.1] File does not
exist: /home/arvis/django/tst/mysite/site.fcgi/works/
[Mon Apr 17 01:24:51 2006] [error] [client 127.0.0.1] File does not
exist: /home/arvis/django/tst/mysite/site.fcgi/works/

thanks in advance

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: update_object and preserving fields

2006-06-01 Thread viestards

I think this can help:
http://code.djangoproject.com/wiki/CookBookManipulatorWithPostpopulatedFields

also look at Django Forms documentation

On 5/30/06, Marcin Kaszynski <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
>
> is there a way to make update_object preserve values of some fields
> without putting them in the update form?
>
> I have a model with a 'creator' field:
>
> class Company(models.Model):
>creator = models.ForeignKey(auth.User, )
>[...]
>
> I want to set this field automatically when a Company gets created (I
> got this part working using the threadlocals trick), but the value
> should not change after that.
>
> I tried several ways to make this work (including a custom save()
> method in the model and a custom CreatorField with a pre_save method
> that set the value if add=True) and so far had no luck: update_object
> simply takes data from POST and if something is not set there then the
> field will be set to None.
>
> Is there some way around it without patching update_object, or do I
> have to write custom views for such models?
>
> -mk
>
> PS. My first post on this group.  Welcome everyone!
>
> >
>

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: dynamic templates for form fields

2006-05-16 Thread viestards

Hi!

Scaffold Script maybe useful to you:
http://code.djangoproject.com/wiki/ScaffoldScript

anyway I suggest looking at generic views, they make append\update easy.
I found this tutorial useful:
http://www.postneo.com/2005/08/17/django-generic-views-crud



On 5/15/06, Alexandre CONRAD <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I've already talked about it in the IRC channel, but I'm posting here to
> make sure...
>
> I have a model Client like so:
>
> class Client(models.Model):
>  name = models.CharField(maxlength=30, core=True)
>  contact_name = models.CharField(maxlength=30, blank=True)
>  contact_email = models.EmailField(blank=True)
>
> So I'd like to add a new client. Isn't it possible to use the
> autogeneration of the admin for my app ?
>
> Instead of writing a template declaring *every* field of the Client
> model, wouldn't it be possible to autogenerate the form from the
> existing model ?
>
> If I never add a new entry in my model, let's say:
>
>  city = models.CharField(maxlength=30, core=True)
>
> when I reload my "add_client" (or "edit_client") page, it would
> automaticly display the form including the new "city" field without
> having to touch my template code.
>
> I'm about to go into a "for" loop inside the form.data dictionnary to
> generate every field. But as it already took me some time to use
> organize the "fields" variable like I wanted for the "Admin" class, I
> was telling myself there *MUST* be someway to reuse the admin code for
> autogenerating forms in my own application.
>
> I have looked into this page:
> http://www.djangoproject.com/documentation/forms/
>
> But it explains I have to write every field into my template.
>
> Any idea ?
>
> Regards,
> --
> Alexandre CONRAD - TLV
> Research & Development
> tel : +33 1 30 80 55 05
> fax : +33 1 30 80 55 06
> 6, rue de la plaine
> 78860 - SAINT NOM LA BRETECHE
> FRANCE
>
>
> >
>

--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---