mirror of
https://github.com/ferdzo/serviceCRM.git
synced 2026-04-04 21:06:24 +00:00
Fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from django import forms
|
||||
from .models import Insert
|
||||
|
||||
|
||||
class DateInput(forms.DateInput):
|
||||
input_type = 'date'
|
||||
|
||||
@@ -16,6 +17,7 @@ class InputForm(forms.ModelForm):
|
||||
'date': DateInput(),
|
||||
'description': forms.Textarea(attrs={'class': 'form-control'})
|
||||
}
|
||||
|
||||
field_order = ["name", "phone", "date", "description", "done"]
|
||||
|
||||
# name = forms.CharField(label="Name", max_length=30)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import UserManager
|
||||
|
||||
|
||||
class Insert(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
phone = models.CharField(max_length=20)
|
||||
@@ -13,5 +14,3 @@ class Insert(models.Model):
|
||||
|
||||
def isDone(self):
|
||||
return self.done
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import django_tables2 as tables
|
||||
from .models import Insert
|
||||
|
||||
|
||||
class InsertTable(tables.Table):
|
||||
class Meta:
|
||||
model = Insert
|
||||
template_name = "serviceCRM/list.html"
|
||||
fields = ['id', 'name', 'phone', 'description', 'date', 'done', 'edit']
|
||||
|
||||
@@ -15,7 +15,7 @@ Including another URLconf
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import include, path
|
||||
from django.urls import path
|
||||
import serviceCRM.views as view
|
||||
|
||||
urlpatterns = [
|
||||
|
||||
@@ -43,6 +43,7 @@ class InsertNew(generic.View):
|
||||
|
||||
return render(request, InsertNew.template_name, {'form': form})
|
||||
|
||||
|
||||
class List(generic.ListView):
|
||||
model = Insert
|
||||
template_name = "serviceCRM/list.html"
|
||||
@@ -53,5 +54,3 @@ def done(request, question_id):
|
||||
if req.isDone():
|
||||
return HttpResponse("Done")
|
||||
return HttpResponse("Not Done")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user