Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
- added authentication to developer page
- added accuracy placeholders to userprofile
  • Loading branch information
dtraviglia committed Nov 5, 2015
1 parent 731b0a5 commit 8aa5f4d5ad193104696d6803c8d512531b7cf7f9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
@@ -4,31 +4,37 @@
# Create your views here.

def home_page(request):
return render(request, 'developerhome.html')
if request.user.is_staff:
return render(request, 'developerhome.html')

def view_dev_status(request):
userprofiles = UserProfile.objects.all()
products = Product.objects.all()
datasets = Dataset.objects.all()
optasks = OpTask.objects.all()
return render(request, 'status.html', {'userprofiles': userprofiles, 'products': products, 'datasets': datasets,'optasks': optasks})
if request.user.is_staff:
userprofiles = UserProfile.objects.all()
products = Product.objects.all()
datasets = Dataset.objects.all()
optasks = OpTask.objects.all()
return render(request, 'status.html', {'userprofiles': userprofiles, 'products': products, 'datasets': datasets,'optasks': optasks})

def view_dev_products(request):
products = Product.objects.all()
return render(request, 'dev_products.html', {'products': products})
if request.user.is_staff:
products = Product.objects.all()
return render(request, 'dev_products.html', {'products': products})

def submit_product(request):
return render(request, 'submit_product.html')
if request.user.is_staff:
return render(request, 'submit_product.html')

def newProduct(request):
dataset = Dataset.objects.create(name=request.POST['product_dataset'])
Product.objects.create(dataset=dataset,
url=request.POST['product_url'],
team=request.POST['product_team'],
name=request.POST['product_name'],
version=request.POST['product_version'],
instructions=request.POST['product_instructions'])
return redirect('/developer/product_comp/')
if request.user.is_staff:
dataset = Dataset.objects.create(name=request.POST['product_dataset'])
Product.objects.create(dataset=dataset,
url=request.POST['product_url'],
team=request.POST['product_team'],
name=request.POST['product_name'],
version=request.POST['product_version'],
instructions=request.POST['product_instructions'])
return redirect('/developer/product_comp/')

def product_comp(request):
return render(request, 'product_comp.html')
if request.user.is_staff:
return render(request, 'product_comp.html')
@@ -82,6 +82,7 @@ class UserProfile(models.Model):
bestGenAccuracy = models.IntegerField(default=0)
bestDevAccuracy = models.IntegerField(default=0)


def __unicode__(self):
return self.user.username

0 comments on commit 8aa5f4d

Please sign in to comment.