install.py 478 B

123456789101112131415161718192021222324
  1. # -*- coding: utf-8 -*-
  2. from demeter.core import *
  3. def manage():
  4. model = Demeter.model('manage_admin')
  5. model.id = 1
  6. info = model.select(type='fetchone')
  7. if not info:
  8. model.role_id = 1
  9. model.username = 'admin'
  10. model.mobile = '15810090845'
  11. model.password = '123456'
  12. model.insert()
  13. model = Demeter.model('manage_role')
  14. model.id = 1
  15. info = model.select(type='fetchone')
  16. if not info:
  17. model.name = '管理员'
  18. model.insert()
  19. manage()
  20. print 'install success!'