from catalogue import forms
from catalogue import helpers
from catalogue.helpers import active_tab, ajax
from catalogue import forms
from catalogue import helpers
from catalogue.helpers import active_tab, ajax
if request.method == "POST":
form = forms.DocumentCreateForm(request.POST, request.FILES)
if form.is_valid():
if request.method == "POST":
form = forms.DocumentCreateForm(request.POST, request.FILES)
if form.is_valid():
if request.method == 'POST':
ids = map(int, filter(lambda i: i.strip() != '', request.POST.get('ids').split(',')))
chunks = map(lambda i: Chunk.objects.get(id=i), ids)
if request.method == 'POST':
ids = map(int, filter(lambda i: i.strip() != '', request.POST.get('ids').split(',')))
chunks = map(lambda i: Chunk.objects.get(id=i), ids)
stage = request.POST.get('stage')
if stage:
try:
stage = Chunk.tag_model.objects.get(slug=stage)
except Chunk.DoesNotExist:
stage = None
stage = request.POST.get('stage')
if stage:
try:
stage = Chunk.tag_model.objects.get(slug=stage)
except Chunk.DoesNotExist:
stage = None
user = User.objects.get(username=username)
except User.DoesNotExist, e:
user = None
user = User.objects.get(username=username)
except User.DoesNotExist, e:
user = None