On Mon, May 25, 2009 at 12:35 PM, martin f krafft <madd...@madduck.net>wrote:

> Hey folks,
>
> while playing around with the DB API last night, we discovered that
> the ORM layer does not enforce content validation.
>
> Since the blank field option defaults to False, we expected to be
> unable to save ORM objects with empty fields, but the DB API will
> let us do just that:
>
>  class BeersOfTheWorld(models.Model):
>    beer = models.CharField(max_length=256)
>
>  b = BeersOfTheWorld()
>  b.save()
>
> and the record was created with an empty string title.
>
> Then we found
>
>  http://code.djangoproject.com/ticket/497
>
> which is marked invalid with a pointer to form manipulators.
>
> Does this reflect the roadmap of Django? Is content validation
> expected from higher layers and the ORM layer won't do it?
>
> --
> martin | http://madduck.net/ | http://two.sentenc.es/
>
> "one should never do anything that
>  one cannot talk about after dinner."
>                                                        -- oscar wilde
>
> spamtraps: madduck.bo...@madduck.net
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEAREDAAYFAkoa1u0ACgkQIgvIgzMMSnW/lwCgnONhjZKtCSJ/MCDQobf6+KUX
> ankAn13F2RaQbWEvgaY1mGLk3LP/8r7A
> =JXgV
> -----END PGP SIGNATURE-----
>
>
Django does not currently support model-validation, there is a google summer
of code project being done by Honza Kral to add support for this.

alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to