My backend is PostgreSQL and days ago I had to declare a field
range, I mean by every INSERT I needed to accept numbers between 100
and 50000 only and that restriction I did by 'hand' with psql
(CHECK). IMO could be easier to have a Field similar to
PositiveIntergerField(), something like:
RangeIntegerField(begin=100, end=50000)
What do you think if I try to write a patch for that?
Regards!
Also personally I think that a custom validator is enough for such a
restriction that you need. And it would be much more important to
implement BLOB fields for saving binary files in the database.
Regards,
Aidas Bendoraitis [aka Archatas]
mmhh, good idea.
> Also personally I think that a custom validator is enough for such a
> restriction that you need. And it would be much more important to
> implement BLOB fields for saving binary files in the database.
>
Could be, however if IntegerField was enough why
PositiveIntegerField() and others was developed? Also, is a custom
validator able to generate SQL code for check constraints. IMO,
there's nothing better to leave the database handle those things.
Regards!
>