mirror of
https://github.com/ferdzo/serviceCRM.git
synced 2026-04-04 21:06:24 +00:00
Fix
This commit is contained in:
@@ -2,4 +2,4 @@ from django.contrib import admin
|
||||
|
||||
from .models import Insert
|
||||
|
||||
admin.site.register(Insert)
|
||||
admin.site.register(Insert)
|
||||
|
||||
@@ -3,4 +3,4 @@ from django.apps import AppConfig
|
||||
|
||||
class serviceCRMconfig(AppConfig):
|
||||
name = "serviceCRM"
|
||||
verbose_name = "Service CRM"
|
||||
verbose_name = "Service CRM"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from django import forms
|
||||
from .models import Insert
|
||||
|
||||
|
||||
class DateInput(forms.DateInput):
|
||||
input_type = 'date'
|
||||
|
||||
@@ -8,17 +9,18 @@ class DateInput(forms.DateInput):
|
||||
class InputForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Insert
|
||||
fields = {"name", "phone", "description", "date","done"}
|
||||
labels = {'name': "Name", 'phone': "Phone", 'date': "Date", 'description': "Description",'done':"Done"}
|
||||
fields = {"name", "phone", "description", "date", "done"}
|
||||
labels = {'name': "Name", 'phone': "Phone", 'date': "Date", 'description': "Description", 'done': "Done"}
|
||||
widgets = {
|
||||
'name': forms.TextInput(attrs={'class':'form-control'}),
|
||||
'name': forms.TextInput(attrs={'class': 'form-control'}),
|
||||
'phone': forms.TextInput(attrs={'class': 'form-control'}),
|
||||
'date': DateInput(),
|
||||
'description':forms.Textarea(attrs={'class': 'form-control'})
|
||||
'description': forms.Textarea(attrs={'class': 'form-control'})
|
||||
}
|
||||
field_order =["name", "phone", "date","description","done"]
|
||||
|
||||
# name = forms.CharField(label="Name", max_length=30)
|
||||
# phone = forms.CharField(label="Phone", max_length=30)
|
||||
# date = forms.DateField()
|
||||
# description = forms.CharField(label="Write description of the problem...", max_length=300)
|
||||
field_order = ["name", "phone", "date", "description", "done"]
|
||||
|
||||
# name = forms.CharField(label="Name", max_length=30)
|
||||
# phone = forms.CharField(label="Phone", max_length=30)
|
||||
# date = forms.DateField()
|
||||
# description = forms.CharField(label="Write description of the problem...", max_length=300)
|
||||
|
||||
@@ -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)
|
||||
@@ -9,9 +10,7 @@ class Insert(models.Model):
|
||||
done = models.BooleanField()
|
||||
|
||||
def __str__(self):
|
||||
return "Ime: "+self.name + " Telefonski broj: "+self.phone+ "\nDefekt: "+self.description + "\nDatum: \n"
|
||||
return "Ime: " + self.name + " Telefonski broj: " + self.phone + "\nDefekt: " + self.description + "\nDatum: \n"
|
||||
|
||||
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"
|
||||
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