http://www.webalice.it/umbertoweb

2006-12-15 Thread Umberto Viano
http://www.webalice.it/umbertoweb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, se

Re: Getters and setters on fields

2006-12-15 Thread Jeremy Bowers
Jacob Kaplan-Moss wrote: > The patch looks pretty good to me; it applies cleanly and all the unit tests > pass (you get major props for including 'em on the first pass :). > > However, I do have one quibble: the addition of ``self._django_initializing`` > inside ``Model.__init__`` has a pretty n

Re: Getters and setters on fields

2006-12-15 Thread Jacob Kaplan-Moss
On 12/15/06 7:14 PM, jerf wrote: > Per a discussion in django-users[1], I'm requesting that getters and > setters be added to fields in Django models, for the same basic reasons > that "property" is a useful keyword in Python. > > Ticket 3418[2] contains a proposed patch. The code is small, but I

Re: DATABASE_CHARSET setting, once and for all

2006-12-15 Thread Jacob Kaplan-Moss
On 12/15/06 4:45 PM, Adrian Holovaty wrote: > Does anybody have comments on that patch before I commit it? I remember looking at that patch and not being able to quite figure out what it does... Let me see if I can figure it out: if I've got ``DATABASE_CHARSET = 'utf-8'`` and I pass a unicode

Re: [Proposal]newforms render can use subtemplate

2006-12-15 Thread limodou
> Could you make your code available? Perhaps file a ticket and upload a patch? My implementation is called EasyForm, and you can get the whole source code from http://cvs.woodpecker.org.cn/svn/woodpecker/SharePlat/trunk the code is in apps/easyform/__init__.py the main code is: class EasyFor

Getters and setters on fields

2006-12-15 Thread jerf
Per a discussion in django-users[1], I'm requesting that getters and setters be added to fields in Django models, for the same basic reasons that "property" is a useful keyword in Python. Ticket 3418[2] contains a proposed patch. The code is small, but I post it here because the potential impact

newforms rendering method

2006-12-15 Thread ~Kender
Couple of things. Firstly, I'd like to see a new rendering method.. Specifically as_div(): Subject: Cause a paragraph isn't always semantically correct, and lists and tables are ugly w/ screen readers. I'd also like the ability for the method to take an optional class argument to set the class

Re: newforms feedback

2006-12-15 Thread Honza Král
On 12/16/06, Gary Doades <[EMAIL PROTECTED]> wrote: > > Adrian Holovaty wrote: > > Ah, but we *will* have USStateField and USStateField field -- I just > > haven't written those Field classes yet. :) > > > > Why not just have a CharField and a USState validator and an IPaddress4 > validator. That w

Re: newforms feedback

2006-12-15 Thread Gary Doades
Adrian Holovaty wrote: > Ah, but we *will* have USStateField and USStateField field -- I just > haven't written those Field classes yet. :) > Why not just have a CharField and a USState validator and an IPaddress4 validator. That way you have a USState validator to apply to other fields as wel

Re: newforms feedback

2006-12-15 Thread Gary Doades
Adrian Holovaty wrote: > If the argument is "It violates DRY to have to create a Field subclass > just to handle an existing validator," I'm not sure that argument > flies, because we will eventually have a Field for every validator. > Ideally, validators wouldn't even *exist* anymore, as Fields c

Re: Re: Bug in tests/modeltests/basic doctests?

2006-12-15 Thread Russell Keith-Magee
On 12/16/06, ogghead <[EMAIL PROTECTED]> wrote: > > Adding this to the lone model in tests/modeltests/basic/models.py fixes > it: > > class Meta: > ordering = ('id',) > > But it seems a bit strange to specify explicitly an ordering for a > column that was implicitly created. Do others

Re: Bug in tests/modeltests/basic doctests?

2006-12-15 Thread ogghead
Adding this to the lone model in tests/modeltests/basic/models.py fixes it: class Meta: ordering = ('id',) But it seems a bit strange to specify explicitly an ordering for a column that was implicitly created. Do others think this is ok? If so, I can create a proper patch if needed

Re: Re: newforms feedback

2006-12-15 Thread Adrian Holovaty
On 12/10/06, Benjamin Slavin <[EMAIL PROTECTED]> wrote: > 1) I think that ComboField is a great idea, but I don't think it > handles all use cases gracefully. There's a rich collection of > validators that have been created that would not be easily accessible > if we have to use ComboField or cre

Re: newforms CharField issue

2006-12-15 Thread Adrian Holovaty
On 12/10/06, Benjamin Slavin <[EMAIL PROTECTED]> wrote: > Also, I noticed that in BooleanField if required=False and the input > is None (or ''), the evaluated result is False. > > I can certainly understand arguments to keep it how it is, but it > seems like 'None' would be a safer return value h

Re: newforms CharField issue

2006-12-15 Thread Adrian Holovaty
On 12/10/06, Benjamin Slavin <[EMAIL PROTECTED]> wrote: > I noticed a parameter pair for CharField in the newforms test package > that produces unexpected (to me) behavior. > > The field type in question is: CharField > The argument pair is: min_length={any-number}, required=False. > > >>> f = Ch

Re: Bug in tests/modeltests/basic doctests?

2006-12-15 Thread Russell Keith-Magee
On 12/16/06, ogghead <[EMAIL PROTECTED]> wrote: > > Is this a fair test? Using the Oracle backend in the > boulder-oracle-sprint branch, I get this: > [, ] > which fails because the doctest expected them in the opposite order. ... > Should I fix the doctest(s) to be more accomodating, or am I mis

Re: DATABASE_CHARSET setting, once and for all

2006-12-15 Thread gabor
Adrian Holovaty wrote: > I recently implemented the form_for_model() helper function in > django.newforms, which returns a Form class for a given Model class. > It has a create() method, which actually creates the object from form > data. This is the replacement for automatic AddManipulator classe

DATABASE_CHARSET setting, once and for all

2006-12-15 Thread Adrian Holovaty
I recently implemented the form_for_model() helper function in django.newforms, which returns a Form class for a given Model class. It has a create() method, which actually creates the object from form data. This is the replacement for automatic AddManipulator classes. But there's a problem -- th

Bug in tests/modeltests/basic doctests?

2006-12-15 Thread ogghead
Here's a snippet from the doctests in tests/modeltests/basic/models.py: # # You can combine queries with & and |. >>> s1 = Article.objects.filter(id__exact=1) >>> s2 = Article.objects.filter(id__exact=2) >>> s1 | s2 [, ] # Is this a fair test? Using the Oracle backend in the boulder-ora

File Uploads Problem

2006-12-15 Thread [EMAIL PROTECTED]
Hey all, I have been bangin my head on this one for a while, any help would be appreciated. I have form that is saving via a custom manipulator that I put together, in this form is an image upload field that I can not get to upload a file - I can get the file name into the db no problem, but the f

Re: utils.text.wrap is O(n^2)

2006-12-15 Thread Adrian Holovaty
On 12/15/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > On 12/15/06 11:26 AM, Michael Radziej wrote: > > when I watched the presentation of GvR's Mondrian, his statement > > that django's word wrapper has quadratic behaviour made me take a > > look. Here's the result ... > > Awesome patch, Mic

Re: DB to Django Models

2006-12-15 Thread Jacob Kaplan-Moss
On 12/15/06 1:38 PM, [EMAIL PROTECTED] wrote: > Hello, i was thinking of developing some modules that did the > transalation from any DataBase supported by Django to the Django > Models. For example, i have a db in production but would like to use it > with Django, then i would have to rewrite all

Re: utils.text.wrap is O(n^2)

2006-12-15 Thread Jacob Kaplan-Moss
On 12/15/06 1:28 PM, John Lenton wrote: > I don't have a 100M text to test with, but I was wondering how changing that > to > > it = (m.group() for m in re.finditer(r'(\S+)', text)) > > would compare in both speed and memory? > (I expect it to use about half as much memory, due to not copying

Re: DB to Django Models

2006-12-15 Thread Joseph Kocherhans
On 12/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello, i was thinking of developing some modules that did the > transalation from any DataBase supported by Django to the Django > Models. For example, i have a db in production but would like to use it > with Django, then i would have

DB to Django Models

2006-12-15 Thread [EMAIL PROTECTED]
Hello, i was thinking of developing some modules that did the transalation from any DataBase supported by Django to the Django Models. For example, i have a db in production but would like to use it with Django, then i would have to rewrite all the Data Base Abstraction but in the Django Models, i

Re: utils.text.wrap is O(n^2)

2006-12-15 Thread John Lenton
On 12/15/06, Michael Radziej <[EMAIL PROTECTED]> wrote: > > it = iter(text.split(' ')) I don't have a 100M text to test with, but I was wondering how changing that to it = (m.group() for m in re.finditer(r'(\S+)', text)) would compare in both speed and memory? (I expect it to use abo

Re: utils.text.wrap is O(n^2)

2006-12-15 Thread Jacob Kaplan-Moss
On 12/15/06 11:26 AM, Michael Radziej wrote: > when I watched the presentation of GvR's Mondrian, his statement > that django's word wrapper has quadratic behaviour made me take a > look. Here's the result ... Awesome patch, Michael. I tested your function a bit myself, made a small tweak for

Re: [Proposal]newforms render can use subtemplate

2006-12-15 Thread Waylan Limberg
On 12/14/06, limodou <[EMAIL PROTECTED]> wrote: > > I saw that newforms has meny output methods, just like: as_table, > as_p, as_ul, etc, and someone also want to add as_dl. And I also saw > that the output is hardcoded in the source code. In my personal > woodlog project, I made an easyform app,

utils.text.wrap is O(n^2)

2006-12-15 Thread Michael Radziej
Hi, when I watched the presentation of GvR's Mondrian, his statement that django's word wrapper has quadratic behaviour made me take a look. Here's the result ... def wrap(text, width): def _generator(): it = iter(text.split(' ')) for word in it: yield word

Re: django.contrib.formtools: High-level abstractions of common form tasks

2006-12-15 Thread rassilon
Hi, I'm Ben's (Afternoon) collegue Tom, As much as I was asked to be interesting, I don't do interesting, or at least when I do, people fall asleep http://www.halfapenguin.com/djmultipartform.tar.gz I've posted the code sample on my server, its not complete, but it is a snapshot of where w

Cproxy5.0

2006-12-15 Thread Sweet.love .
Cproxy5.0 The program features High-speed browser Hide the IP address Easy to use Compatible with all operating systems Download click here Or click here _ -_-_-_-_-_-_- --~--~-~