Commits

Luke Plant committed 662c632

Addded 'similar_datetime' and 'similar_date' shortcuts.

  • Participants
  • Parent commits 20dc2dd

Comments (0)

Files changed (2)

 
 * Changed 'varchar' field to do max_length introspection at runtime.
   This breaks the previous signature of the function.
+* Introduced 'replacers' module and new shortcuts.
 
 
 Version 0.1.1

anonymizer/replacers.py

 zip_code = lambda anon, obj, field, val: anon.faker.zip_code(field=field)
 company = lambda anon, obj, field, val: anon.faker.company(field=field)
 lorem = lambda anon, obj, field, val: anon.faker.lorem(field=field)
+
+# These use the value of the field to return a date/datetime that is close
+# (within two years) of the original value.
+similar_datetime = lambda anon, obj, field, val: anon.faker.datetime(field=field, val=val)
+similar_date = lambda anon, obj, field, val: anon.faker.date(field=field, val=val)