Refactor#1
Conversation
| pass | ||
|
|
||
|
|
||
| @admin.register(SuiteDetail) |
There was a problem hiding this comment.
huh I didn't know you could add a decorator to do an admin.register...
neat!
| height: 100%; | ||
| width: 100%; | ||
| position: absolute; } | ||
| background-color: #FEFEFE !important; } |
| @@ -46,24 +46,16 @@ html { | |||
| font-family: "Trebuchet MS", sans-serif; } | |||
There was a problem hiding this comment.
The closing curly brace should be on the next line
There was a problem hiding this comment.
this is autogenerated via sass
| {% load static %} | ||
| <link rel="stylesheet" type="text/css" href="{% static 'projects/css/style.css' %}"> | ||
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" | ||
| integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> |
There was a problem hiding this comment.
Huh ... good use of html5 integrity / crossorigin attributes!
There was a problem hiding this comment.
sarcasm? I copypasta'd
There was a problem hiding this comment.
Come on at least take credit for it! Do you understand what they do? Here's a good explanation. Essentially it's like a simple way of defining CORS (cross-origin resource sharing) as well as verifying that nothing is tampering with your CDN code.
| <th class="left-align">Result</th> | ||
| <th class="right-align">Actions</th> | ||
| </tr> | ||
| {% for btd in tests %} |
There was a problem hiding this comment.
try and be more verbose in variable names. I have no idea what btd is!
There was a problem hiding this comment.
all of these have been renamed
| <th class="left-align">Description</th> | ||
| <th class="right-align">Actions</th> | ||
| </tr> | ||
| {% for bid in builds %} |
There was a problem hiding this comment.
again, bid isn't overly helpful. try to use the singular. something like the following is the pythonic way:
for instance in instances:
instance.do_your_thing()| <th class="left-align">Required?</th> | ||
| <th class="right-align">Actions</th> | ||
| </tr> | ||
| {% for td in tests %} |
There was a problem hiding this comment.
I feel like td could be confused for table data. again, probably best with test for this one.
| @@ -0,0 +1,306 @@ | |||
| from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView | |||
| from .models import * | |||
| from .models import * | ||
| from django.http import HttpResponseRedirect | ||
| from datetime import datetime | ||
| import reversion |
There was a problem hiding this comment.
The order of imports should be (according to PEP8):
standard library imports
related third party imports
local application/library specific importsYou should put a blank line between each group of imports.
| # Create your views here. | ||
| class IndexView(ListView): | ||
| template_name = 'projects/index.html' | ||
| context_object_name = 'projects' |
There was a problem hiding this comment.
again, this should reference a global specified in settings.
| # DETAILS | ||
| class ProjectDetailView(DetailView): | ||
| model = ProjectDetail | ||
| context_object_name = 'pd' |
There was a problem hiding this comment.
What's wrong with just project rather than pd? Try and be descriptive in variable names.
There was a problem hiding this comment.
Actually come to think of it - why have you got Detail after every model?
| detail.save() | ||
| # Create a test suite for the bundle | ||
| with reversion.create_revision(): | ||
| suite = SuiteDetail(bundle=detail, name=detail.name + ' Testing Suite', description='Test suite for ' + detail.name) |
There was a problem hiding this comment.
rather than adding together strings use the format syntax:
tom = 'tom'
new_string = '{} is a cool dude'.format(tom)There was a problem hiding this comment.
yeah I wasn't thinking in python
There was a problem hiding this comment.
If you're in Python 3.6 you can do f'{tom} is a cool dude'
There was a problem hiding this comment.
that's kinda like the es6 backtick stuff in javascript then. neat
Sorry for the big commit
Added the reporting page with chart.js. Some css changes

No description provided.