PageRenderTime 37ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/withWebConf.py

https://bitbucket.org/dbp/withweb
Python | 30 lines | 17 code | 4 blank | 9 comment | 0 complexity | a823445523bf7be7827ce673c6872d27 MD5 | raw file
  1. # ('username', 'password', 'email'), can edit everything
  2. SuperUsers = [
  3. ('name', 'password', 'email')
  4. ,]
  5. # ('username', 'password'), can only edit what they create, and when explicitly listed in data
  6. Users = [
  7. ('name2', 'password2')
  8. ,('name3', 'password3')]
  9. # ('itemname', [(fieldName, type, {properties}),], ['users','who','have','these'], {'dict':'extra properties'}),
  10. # possible types: "Text", "LongText", "Photo", "MP3", "Checkbox", and "Dropdown"
  11. # for "Photo", you need 'imsize' : (int(width), int(height)), thumbsize : (int(width), int(height)) in the extra properties dict, this will set up scaling.
  12. # note MP3s use the xspf media player, if you search for the string "_INSERT_DOMAIN_HERE" in the resuling app_XXXX.py file, you should be able to figure out where to put the .swf file needed.
  13. # for "Dropdown" you need 'data' : [list,of,options] or [(key,value),] list
  14. DataMany = [
  15. ('item', [('property', 'Text', {'valid':'notnull'}),], ['name', 'name2'], {'sort' : "field2 DESC"})
  16. ,]
  17. # same as above, except only one can exist, and always does exist.
  18. DataSingle = [
  19. ('item2', [('property', 'LongText', {})], ['name', 'name2'], {})
  20. ,]
  21. # ('/path/to/url', 'name_of_page', [('item', 'where=clause', if autoiterating),]
  22. Urls = [
  23. ('/', 'index', [])
  24. ,('/items', 'items', [('item1', 'user="name2"', True),('item2', '', False)])
  25. ,('/other', 'other', [])
  26. ,]