How to compare two versions?
ver_cmp('1.6.2', '1.6')
- comparison
ver_cmp('1.6.2', '1.6')
This compares two objects (of the same model) and returns a tuple containing dictionaries with the changed attributes. Note that ALL attributes are run through comparison, so if you are modifying non-field attributes at runtime, these will also be included. Excluded keys is a tuple containing the names if attributes you do not want to include in the comparison loop (i.e. attributes which changes are irrelevant).
This is simple validation weather a string is close enough to what we want. First param is keyword we are comparing to Second is user's input and third is tolerance level. Its very rudimentary. I have my mind fixed upon some imperfections. I am trying to make it good for human like(crazy keyboard) error.
Lets you compare two objects based on fields
4 snippets posted so far.