> On 3/15/06, Christopher Lenz <[EMAIL PROTECTED]> wrote:
>> I definitely agree that the model layer should do validation, as long
>> as that doesn't mean it's the *only* layer that does validation
>> (that's not how I understood the proposal, but some some of the
>> comments seemed to imply that)
Adrian Holovaty wrote:
> On 3/15/06, Christopher Lenz <[EMAIL PROTECTED]> wrote:
>> Example: the string representation of a date in may depend on the
>> locale of the remote user, which the model knows nothing about. The
>> conversion from string to datetime will need to happen in a layer
>> that
On 3/15/06, Christopher Lenz <[EMAIL PROTECTED]> wrote:
> I definitely agree that the model layer should do validation, as long
> as that doesn't mean it's the *only* layer that does validation
> (that's not how I understood the proposal, but some some of the
> comments seemed to imply that). I ma
Am 15.03.2006 um 07:39 schrieb Russell Keith-Magee:
> Addressing the arguments against::
> 1) Validation shouldn't be in the model
>
> If validation isn't in the model, then the model is little more
> than a light data container; if all you have is a light data
> container, then the onus is on
On 3/13/06, Adrian Holovaty <[EMAIL PROTECTED]
> wrote:
Thoughts, criticisms? The only part I'm sketchy on is the side effectof converting the values to their Python data types. Thecleanliness/consistency is quite nice, but it's slightly not somethinga developer might expect. However, we can solve
On 3/14/06, Amit Upadhyay <[EMAIL PROTECTED]> wrote:
> This is based on a simplistic assumption that everytime we are talking about
> validation in django context we are talking about model based validation.
No, it's based on an assumption that the facilities for doing custom
validation that curr
On 3/13/06, Christopher Lenz <[EMAIL PROTECTED]> wrote:
>
> Am 13.03.2006 um 08:00 schrieb Adrian Holovaty:
> [snip]
> > Thoughts, criticisms? The only part I'm sketchy on is the side effect
> > of converting the values to their Python data types. The
> > cleanliness/consistency is quite nice, but
On 3/14/06, James Bennett <[EMAIL PROTECTED]> wrote:
* It's conceptually simpler; instead of worrying about whichvalidation layer you got down to before an error occurred, you onlyhave to worry about two states: success and failure.* It's more logical; I still don't see any good reason why informat
Gábor Farkas wrote:
>or have a new constructor, that takes a dictionary of strings:
>
>def myview(request):
> try:
> m = MyModel( request.POSTDATA)
> m.save()
> except SomethingFailedError:
> //handle it
>
>
I also proposed something like th
Gábor Farkas wrote:
>> Thoughts, criticisms? The only part I'm sketchy on is the side effect
>> of converting the values to their Python data types. The
>> cleanliness/consistency is quite nice, but it's slightly not something
>> a developer might expect. However, we can solve the latter through
>
Jacob Kaplan-Moss wrote:
> On Mar 13, 2006, at 9:41 PM, James Bennett wrote:
>> Sure they can. Imagine explaining Django to someone who's never seen
>> an MVC model before; if you told them "the model is where you provide
>> all the information about a class of objects, and describe how it
>> work
limodou wrote:
> On 3/14/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
>> On Tue, 2006-03-14 at 09:34 +0800, limodou wrote:
>> [...]
>>> -1 I agree with gabor. Many orm models don't process validation, and
>>> these things should be implemented by manipulator. Why do so much
>>> things in mode
limodou wrote:
> Reasons sound very reasonable. But I think current implement in django
> is enough. Maybe model with validation is better but unnecessary. We
> have many ways to validate data before it saved in db.
Any Security Foil-Hat will tell: Validate early and validate often. It
makes no
On 3/14/06, James Bennett <[EMAIL PROTECTED]> wrote:
>
> On 3/13/06, limodou <[EMAIL PROTECTED]> wrote:
> > Maybe or maybe not. What django has implemented is exactly as what I
> > said, I think the ways is good. And I remember there was a discussion
> > about js invalidation, why we need this. Be
On 3/13/06, limodou <[EMAIL PROTECTED]> wrote:
> Maybe or maybe not. What django has implemented is exactly as what I
> said, I think the ways is good. And I remember there was a discussion
> about js invalidation, why we need this. Because we want to make
> mistakes can be found early, but not un
On 3/14/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:
>
> On Mar 13, 2006, at 9:41 PM, James Bennett wrote:
> > Sure they can. Imagine explaining Django to someone who's never seen
> > an MVC model before; if you told them "the model is where you provide
> > all the information about a class of
On 3/14/06, James Bennett <[EMAIL PROTECTED]> wrote:
>
> On 3/13/06, limodou <[EMAIL PROTECTED]> wrote:
> > In most cases we do not do anything alone use model, but always there
> > is a ui layer, such as gui or web. They have to do any such thing.
>
> There should be the ability to generate an HT
On Mar 13, 2006, at 9:41 PM, James Bennett wrote:
> Sure they can. Imagine explaining Django to someone who's never seen
> an MVC model before; if you told them "the model is where you provide
> all the information about a class of objects, and describe how it
> works", they'd be awfully confused
On 3/13/06, limodou <[EMAIL PROTECTED]> wrote:
> In most cases we do not do anything alone use model, but always there
> is a ui layer, such as gui or web. They have to do any such thing.
There should be the ability to generate an HTML form for
creating/changing an instance of a model, yes, but t
On 3/14/06, limodou <[EMAIL PROTECTED]> wrote:
> On 3/14/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> >
> > On Tue, 2006-03-14 at 09:34 +0800, limodou wrote:
> > [...]
> > >
> > > -1 I agree with gabor. Many orm models don't process validation, and
> > > these things should be implemented b
On 3/14/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
>
> On Tue, 2006-03-14 at 09:34 +0800, limodou wrote:
> [...]
> >
> > -1 I agree with gabor. Many orm models don't process validation, and
> > these things should be implemented by manipulator. Why do so much
> > things in model?
>
> This i
On 3/14/06, James Bennett <[EMAIL PROTECTED]> wrote:
>
> On 3/13/06, limodou <[EMAIL PROTECTED]> wrote:
> > -1 I agree with gabor. Many orm models don't process validation, and
> > these things should be implemented by manipulator. Why do so much
> > things in model?
>
> Among other things, the mo
On Tue, 2006-03-14 at 09:34 +0800, limodou wrote:
[...]
>
> -1 I agree with gabor. Many orm models don't process validation, and
> these things should be implemented by manipulator. Why do so much
> things in model?
This isn't really an argument, though. Other systems working differently
is not
On 3/13/06, limodou <[EMAIL PROTECTED]> wrote:
> -1 I agree with gabor. Many orm models don't process validation, and
> these things should be implemented by manipulator. Why do so much
> things in model?
Among other things, the model is the place where the types of data are
specified for a parti
On 3/13/06, Gábor Farkas <[EMAIL PROTECTED]> wrote:
>
> Adrian Holovaty wrote:
> >
> > EXAMPLE CODE:
> >
> > class Person(models.Model):
> > name = models.CharField(maxlength=50)
> > birthday = models.DateField()
> > favorite_number = models.IntegerField()
> >
> p = Person(name='J
Am 13.03.2006 um 08:00 schrieb Adrian Holovaty:
[snip]
> Thoughts, criticisms? The only part I'm sketchy on is the side effect
> of converting the values to their Python data types. The
> cleanliness/consistency is quite nice, but it's slightly not something
> a developer might expect. However, we
All,
Validation aware models have seen allot of attention so far with a
number of proposals out there. This proposal, like the others, has
it's strengths and weaknesses. This method of validating models is a
good start, and will surely evolve or be replaced over time. I believe
that we need t
On 3/13/06, Amit Upadhyay <[EMAIL PROTECTED]> wrote:
> Does it mean AddManipulator/UpdateManipulator are going
> away?
Yes, the automatic manipulators are going away, but there will of
course still be away to generate forms/manipulators automatically from
a model.
Adrian
--
Adrian Holovaty
holo
HI Adrian,Does it mean AddManipulator/UpdateManipulator are going away?This way of doing things is inconsitant with handling custom forms. If it is, a good step for django ORM, a bad step for django web framework.
Let me elaborate, this is my typical view:def confirm_email(request): if not requ
Adrian Holovaty wrote:
>
> EXAMPLE CODE:
>
> class Person(models.Model):
> name = models.CharField(maxlength=50)
> birthday = models.DateField()
> favorite_number = models.IntegerField()
>
p = Person(name='Joe', birthday='never', favorite_number='foo')
p.validate()
> {'bir
Just got back from a week-long Hawaii vacation, so I'm getting back
into the Django groove. Earlier today I committed the first stab at
validation-aware models on the magic-removal branch:
http://code.djangoproject.com/changeset/2518
Here's how it works:
* Model instances have a validate() meth
31 matches
Mail list logo