I was reading this article
http://discuss.joelonsoftware.com/default.asp?joel.3.309321.4
and I really liked that django doesn't have any of the reasons the author has
mentioned, except no. 4
> 4. RAILS ATE MY DATA, OR AT LEAST STOOD IDLY BY WHILE MY \
> DATA WAS EATEN
I tried to check how django handles this, so I used this model
---------
class Task(Model):
title = CharField('Task', maxlength=100, unique=True)
description = TextField(blank=True)
priority = CharField(maxlength=1, choices=TASK_PRIO, radio_admin=True)
-------
and tried to execute this (on the shell)
-------
>>> t = models.Task(title='1'*200)
>>>
>>> t.save()
-------
Now, the problems are
1. The "title" field is exceeding the maximim size
2. Other *required* fields was not set
Shouldn't these be done at the "save" method? Django shouldn't depend on the
DBMS do these checks, because some fields cannot be represented by the
underlying DB
I'm using django version 0.96 pre & Sqlite
Mohammad Tayseer
http://spellcoder.com/blogs/tayseer
---------------------------------
Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---