Sfoglia il codice sorgente

initial adding of quote to system.

Steve Thielemann 7 anni fa
parent
commit
5649246f2a
2 ha cambiato i file con 38 aggiunte e 0 eliminazioni
  1. 3 0
      django_site/quotes/admin.py
  2. 35 0
      django_site/quotes/models.py

+ 3 - 0
django_site/quotes/admin.py

@@ -0,0 +1,3 @@
+from django.contrib import admin
+from .models import Quote
+admin.site.register(Quote)

+ 35 - 0
django_site/quotes/models.py

@@ -0,0 +1,35 @@
+from django.db import models
+from django.contrib.auth.models import User
+
+STATUS_CHOICES = (
+    ('NEW', 'New Site'),
+    ('EX', 'Existing Site'),
+    )
+
+PRIORITY_CHOICES = (
+    ('U', 'Urgent - 1 week or less'),
+    ('N', 'Normal - 2 to 4 weeks'),
+    ('L', 'Low - Still Researching'),
+)
+
+class Quote(models.Model):
+    name = models.CharField(max_length=100)
+    position = models.CharField(max_length=60, blank=True)
+    company = models.CharField(max_length=60, blank=True)
+    address = models.CharField(max_length=200, blank=True)
+    phone = models.CharField(max_length=30, blank=True)
+    email = models.EmailField()
+    web = models.URLField(blank=True)
+    description = models.TextField()
+    sitestatus = models.CharField(max_length=20, choices=STATUS_CHOICES)
+    priority = models.CharField(max_length=40, choices=PRIORITY_CHOICES)
+    jobfile = models.FileField(upload_to='uploads/', blank=True)
+    submitted = models.DateField(auto_now_add=True)
+    quotedate = models.DateField(blank=True, null=True)
+    quoteprice = models.DecimalField(decimal_places=2, max_digits=7, blank=True, default=0)
+    username = models.ForeignKey(User, blank=True, null=True)
+
+    def __str__(self):
+        return str(self.id)
+
+