您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

data_migrations.py 638 B

123456789101112131415
  1. import json
  2. from api import models
  3. def create_password_with(entry):
  4. settings = json.dumps(entry.password.settings)
  5. lowercase = 'lowercase' in settings
  6. uppercase = 'uppercase' in settings
  7. symbols = 'symbols' in settings
  8. numbers = 'numbers' in settings
  9. user = models.LessPassUser.objects.get(id=entry.user.id)
  10. models.Password.objects.create(id=entry.id, site=entry.site, login=entry.login, user=user,
  11. lowercase=lowercase, uppercase=uppercase, symbols=symbols, numbers=numbers,
  12. counter=entry.password.counter, length=entry.password.length)