Re: Creating a new field type

2006-07-24 Thread adurdin
One other side effect of the problem noted in my message above is this: If I enter "1e5" in the text field, it fails validation (as I'm limiting it to -?\d+(\.\d+)? ), but the new_data entry still gets converted to a Decimal instance, so the form displays an error message but the data in the box

Re: Creating a new field type

2006-07-24 Thread adurdin
Jacob Kaplan-Moss wrote: > > A good example might be to look at the ``DateField`` definition > (http://code.djangoproject.com/browser/django/trunk/django/db/models/ > fields/__init__.py#L393). > > As far as I remember, the methods you'll want to play with are > ``Field.to_python()``, ``Field.get_d

Creating a new field type

2006-07-21 Thread adurdin
I'm trying to create a new database field type, and am not sure what method of models.Field I need to override to convert the value returned from the database to the appropriate Python type and vice-versa -- if indeed it should be done in models.Field. For the sake of example, assume I want to st

Wiki spam

2006-07-20 Thread adurdin
There are three spam attachments on http://code.djangoproject.com/wiki/TracReports -- can someone with delete permissions get rid of them? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. T

Re: Auto-escaping patch

2006-07-17 Thread adurdin
Malcolm Tredinnick wrote: > When a variable is evaluated in a context in a template, it is > considered to be either "safe" or not (Simon used the term "escaped", > but that seemed less universally true than "safe"). As long as we're discussing terminology, might as well enumerate the situations

Re: Manipulators going away?

2006-07-10 Thread adurdin
#2207 was closed as "wontfix", because Adrian said: > Because the automatic manipulators (in their current form) are going away > before 1.0, there's no point in adding this to Django. And he wrote a similar comment about automatic maniuplators going away on #1334. So I don't know whether its

Re: Proposal: default escaping (and branch request)

2006-06-21 Thread adurdin
Michael Radziej wrote: > > IMO, the point of auto-escaping is that the template author should not have > to worry about > the origin of the string, but about how he uses it. The origin of the string > in the > context can change, just for an example. Or are we talking about different > meanings

Re: Recursive delete problem

2006-06-20 Thread adurdin
Viktor wrote: > > Django's ORM is not about tables, columns and rows... It's about objects > (or I'm missing something :)... I'm been wondering the same thing, but with a different reason. My guess is that django's not (yet, at any rate) trying to provide a full ORM, but rather a thin, convenien

Re: Proposal: default escaping (and branch request)

2006-06-20 Thread adurdin
Michael Radziej wrote: > > adurdin wrote: > > You could simply encode the URL, as you currently need to do anyway, and then > mark it as escaped. True. > > Having the context aware of the primary escaping needs of the output is > > a nice idea, but as James Bennett p

Re: Proposal: default escaping (and branch request)

2006-06-20 Thread adurdin
adurdin wrote: > > The main drawback I see with this is that the behaviour of > {{mylist|count}} is not obviously unescaped. I meant {{mylist|length}}, of course. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

Re: Proposal: default escaping (and branch request)

2006-06-20 Thread adurdin
Simon Willison wrote: > I've written up a proposal for how we can implement auto escaping > while hopefully keeping most people happy: > > http://code.djangoproject.com/wiki/AutoEscaping A very nice solution, with a good method of automatically flagging things as escaped or not; but it seems to m