コード例 #1
0
ファイル: index.py プロジェクト: scottyadean/picbiz
    def login(req):
        errors = []
        if req.user.is_authenticated:
            return Controller.goto('/collect/index')

        if req.method == "POST":
            username = req.POST.get('username')
            password = req.POST.get('password')
            user = authenticate(req, username=username, password=password)
            if user is not None:
                login(req, user)
                return Controller.goto('/collect/index')
            errors.append("Hmm I cant find that user/password combo")

        ctx = {"errors": errors}
        return Controller.render(req, ctx, 'login/login.html')
コード例 #2
0
 def read(req):
   if req.method != 'POST':
       return Controller.goto('/collect/index')
   path  = req.POST.get('path')
   data  = {'status':'processing', 'name': os.path.basename(path), 'create_by': req.user.username }
   mkdir, created = Directory.objects.get_or_create(full_path=path, defaults=data,)
   sect  = req.POST.get('section-select')
   loc   = req.POST.get('location-select')
   sect_obj = Section.objects.filter(id=1).values('id', 'name')[0]
   loc_obj  = Location.objects.filter().values('id', 'name')[0]
   ctx = {"path": path, "section_id":sect, "sect_obj":sect_obj, 'loc_id':loc, 'loc_obj':loc_obj, "mkdir": mkdir}
   return Controller.render(req, ctx, 'collect/read.html')
コード例 #3
0
ファイル: index.py プロジェクト: scottyadean/picbiz
 def logout(req):
     logout(req)
     return Controller.goto('index')
コード例 #4
0
ファイル: images.py プロジェクト: scottyadean/picbiz
 def index(req):
   return Controller.goto('index/index.html')