Commit dc3b5464 authored by Pierre Ashley Salcedo's avatar Pierre Ashley Salcedo

Merge branch 'salcedo/homepage'

parents df549949 659e08f0
from django.urls import path
from . import views
from .views import HomepageView
app_name = "homepage"
urlpatterns = [
path("", views.index, name="homepage"),
path("", views.HomepageView.as_view(), name="homepage"),
path("users/add/", views.add, name="add"),
path("users/<int:user_id>/details/", views.detail, name="detail")
]
\ No newline at end of file
from django.shortcuts import redirect, render
from django.http import Http404, HttpResponse
from django.http import Http404
from django.views import View
from .models import WidgetUser
from .forms import UserForm
# Create your views here.
def index(request):
user_list = WidgetUser.objects.order_by("last_name")
context = {
"user_list": user_list
}
return render(request, "homepage/index.html", context)
class HomepageView(View):
def get(self, request):
user_list = WidgetUser.objects.order_by("last_name")
context = {
"user_list": user_list
}
return render(request, "homepage/index.html", context)
def detail(request, user_id):
try:
......
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