Verified Commit 1a61c3d1 authored byBrowse files
Add first validators to models
repo_management/models.py: Add validators to the `BuildDate`, `CSize`, `ISize`, `Name` and `Version` models to ensure positive integers, correct names and versions. Add the comparator instance methods `Version.is_older_than()` and `Version.is_newer_than()` which rely on pyalpm's `vercmp()` to compare two version strings and return whether they are older or newer (respectively). Update the documentation for `ISize` to reflect, that it represents size of an installed package. tests/test_models.py: Add tests for added validators and comparator methods.
Showing with 201 additions and 6 deletions