Commit 19770cef authored by Gabriel G. Garrero's avatar Gabriel G. Garrero Committed by Ysabella Panghulan

Fixed urls to widgetusers: removed

'dashboard/' before it
parent 6f329e2f
...@@ -8,7 +8,7 @@ class Department(models.Model): ...@@ -8,7 +8,7 @@ class Department(models.Model):
home_unit = models.CharField(max_length = 100) home_unit = models.CharField(max_length = 100)
def __str__(self): def __str__(self):
return self.dept_name return self.dept_name + ', ' + self.home_unit
class WidgetUser(models.Model): class WidgetUser(models.Model):
first_name = models.CharField(max_length = 50) first_name = models.CharField(max_length = 50)
...@@ -17,7 +17,7 @@ class WidgetUser(models.Model): ...@@ -17,7 +17,7 @@ class WidgetUser(models.Model):
department = models.ForeignKey(Department, on_delete = models.CASCADE) department = models.ForeignKey(Department, on_delete = models.CASCADE)
def __str__(self): def __str__(self):
return self.last_name + ' ' + self.first_name return self.last_name + ', ' + self.first_name
def get_absolute_url(self): def get_absolute_url(self):
return reverse("dashboard:widgetuser-details", kwargs={"pk": self.pk}) return reverse("widgetusers:widgetuser-details", kwargs={"pk": self.pk})
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
{% endfor %} {% endfor %}
</ol> </ol>
</div> </div>
<a href="/dashboard/widgetusers/add" class="add-btn"><i class="fa fa-plus"></i> Add Widget User</a> <a href="../widgetusers/add" class="add-btn"><i class="fa fa-plus"></i> Add Widget User</a>
</div> </div>
{% endblock %} {% endblock %}
<div class="links"> <div class="links">
......
...@@ -4,9 +4,9 @@ from .views import dashboard, WidgetUserDetailView, WidgetUserCreateView, Widget ...@@ -4,9 +4,9 @@ from .views import dashboard, WidgetUserDetailView, WidgetUserCreateView, Widget
urlpatterns = [ urlpatterns = [
path('', dashboard, name = 'dashboard'), path('', dashboard, name = 'dashboard'),
path('widgetusers/<int:pk>/details', WidgetUserDetailView.as_view(), name = 'widgetuser-details'), path('<int:pk>/details/', WidgetUserDetailView.as_view(), name = 'widgetuser-details'),
path('widgetusers/add', WidgetUserCreateView.as_view(), name = "widgetuser-add"), path('add/', WidgetUserCreateView.as_view(), name = "widgetuser-add"),
path('widgetusers/<int:pk>/edit', WidgetUserUpdateView.as_view(), name = "widgetuser-edit"), path('<int:pk>/edit/', WidgetUserUpdateView.as_view(), name = "widgetuser-edit"),
] ]
app_name = "dashboard" app_name = "dashboard"
\ No newline at end of file
...@@ -22,5 +22,6 @@ urlpatterns = [ ...@@ -22,5 +22,6 @@ urlpatterns = [
path('forum/', include("forum.urls", namespace = "forum")), path('forum/', include("forum.urls", namespace = "forum")),
path('announcements/', include('announcementboard.urls')), path('announcements/', include('announcementboard.urls')),
path('dashboard/', include('dashboard.urls', namespace = "dashboard")), path('dashboard/', include('dashboard.urls', namespace = "dashboard")),
path("widgetusers/", include("dashboard.urls", namespace="widgetusers")),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
] ]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment