diff options
| author | Mitch Riedstra <Mitch@riedstra.us> | 2017-10-18 17:50:47 -0400 |
|---|---|---|
| committer | Mitch Riedstra <Mitch@riedstra.us> | 2017-10-18 17:50:47 -0400 |
| commit | ae4f2514267571c0bdf9bfa933600abe9cc8baa6 (patch) | |
| tree | fa93124fa06b04434f494d6116a9cf98c3acc61c /app/dispatch | |
| parent | 5b2f6041e739be4810709ca49d0538279d3f549d (diff) | |
| download | dispatch-tracker-ae4f2514267571c0bdf9bfa933600abe9cc8baa6.tar.gz dispatch-tracker-ae4f2514267571c0bdf9bfa933600abe9cc8baa6.tar.xz | |
Go to the view page after create/edit
Diffstat (limited to 'app/dispatch')
| -rw-r--r-- | app/dispatch/models.py | 4 | ||||
| -rw-r--r-- | app/dispatch/templates/dispatch/loads/list.html | 2 | ||||
| -rw-r--r-- | app/dispatch/views.py | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/app/dispatch/models.py b/app/dispatch/models.py index 0dd2ac7..62af763 100644 --- a/app/dispatch/models.py +++ b/app/dispatch/models.py @@ -29,6 +29,10 @@ class Load(models.Model): return "{c}, {d} ( {a} )".format(c=self.company, d=self.description, a=self.amount) + def get_absolute_url(self): + return "/loads/view/%i" % self.id + + # This is used to set the upload path of the document for Paperwork Objects diff --git a/app/dispatch/templates/dispatch/loads/list.html b/app/dispatch/templates/dispatch/loads/list.html index fec2371..0620fba 100644 --- a/app/dispatch/templates/dispatch/loads/list.html +++ b/app/dispatch/templates/dispatch/loads/list.html @@ -51,7 +51,7 @@ <td>{{ load.load_number }}</td> <td>{{ load.description }}</td> <td class="right-align"> - <a href="{% url 'load_edit' load.id %}" class="btn orange">Edit</a> + <!-- <a href="{% url 'load_edit' load.id %}" class="btn orange">Edit</a> --> <a href="{% url 'load_detail' load.id %}" class="btn blue">View</a> </td> </tr> diff --git a/app/dispatch/views.py b/app/dispatch/views.py index ef17666..63a6a09 100644 --- a/app/dispatch/views.py +++ b/app/dispatch/views.py @@ -187,7 +187,6 @@ class LoadList(FilteredListView): class LoadCreate(CreateView): template_name = "dispatch/loads/create.html" model = Load - success_url = reverse_lazy('load_list') fields = ['date', 'company', 'load_number', 'description', 'delivered_to', 'amount'] def get(self,request): @@ -215,7 +214,6 @@ class LoadDetail(DetailView): class LoadUpdate(FilteredUpdateView): template_name = "dispatch/loads/edit.html" model = Load - success_url = reverse_lazy('load_list') fields = ['date', 'company','load_number','description', 'delivered_to', 'amount'] def get(self,request,pk): |
