Commits

Anonymous committed ed428e9

user: lablinux
branch 'default'
added LICENSE
changed invoices/urls.py
changed settings.py
changed templates/invoices/index.html

Comments (0)

Files changed (5)

+# Copyright Michele Casari email lablinux@gmail.com
+# All rights reserved.
+#
+#
+# Redistribution and use of this software, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this software must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

invoices/models.py

         if self.status == 'I' and self.dateissue == None:
             if dateissue == None:
                 self.dateissue = datetime.today()
-                self.yearissue = datetime.today().year()
+                self.yearissue = datetime.today().year
             else:
                 self.dateissue = dateissue
                 self.yearissue = dateissue[0:4]
     url(r'^/additem/$', 'additem',  name='invoices-additem'),
     url(r'^/download/(?P<id>\d+)/$', 'download',  name='invoices-download'),
     url(r'^/getit/(?P<findrandomnumber>\w{56})/$', 'getit',  name='invoices-getit'),
+    url(r'^/delete/(?P<id>\d+)/$'            , 'delete' , name='invoices-delete'),
     #url(r'^/ajaxgetit/(?P<findrandomnumber>\w{56})/$', 'ajaxgetit',  name='invoices-ajaxgetit'),
 )
 
-if settings.DEBUG:
-    urlpatterns += patterns('invoices.views',
-        url(r'^/delete/(?P<id>\d+)/$'            , 'delete' , name='invoices-delete'),
-    )
 
 ##url(r'^/pdf/(?P<id>\d+)/$', 'pdf',  name='invoicehes-pdf'),
 ##url(r'^/update/(?P<id>\d)/$'            , 'update' , name='invoicehes-update'),
 
 #email info
 EMAIL_USE_TLS = True
-EMAIL_HOST = 'smtp.gmail.com'
-EMAIL_HOST_USER = 'lablinux At gmail d0t com'
+EMAIL_HOST = '***********'
+EMAIL_HOST_USER = 'lablinux At gmail dOt com'
 EMAIL_HOST_PASSWORD = '****'
 EMAIL_PORT = 587
 
 ADMINS = (
-    ('Michele', 'lablinux At gmail d0t com'),
+    ('Michele', 'lablinux@gmail.com'),
 )
 
 MANAGERS = ADMINS
-
-if sys.platform != 'win32':
+#psycopg2
+#if sys.platform.lower().startswith("win"):
+#DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+#DATABASE_NAME = os.path.join(PROJECT_PATH, 'media', 'db.sqlite3')            # Or path to database file if using sqlite3.
+if sys.platform == 'win32':
     DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
     DATABASE_NAME = os.path.join(PROJECT_PATH, 'media', 'db.sqlite3')           # Or path to database file if using sqlite3.
     DATABASE_USER = ''             # Not used with sqlite3.
     DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.
 else:
     DATABASE_ENGINE = 'postgresql_psycopg2'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-    DATABASE_NAME = '----------'            # Or path to database file if using sqlite3.
-    DATABASE_USER = '--------'             # Not used with sqlite3.
-    DATABASE_PASSWORD = '-----------'      # Not used with sqlite3.
-    DATABASE_HOST = '-------------'         # Set to empty string for localhost. Not used with sqlite3.
-    DATABASE_PORT = '------'           # Set to empty string for default. Not used with sqlite3.
+    DATABASE_NAME = '**********'            # Or path to database file if using sqlite3.
+    DATABASE_USER = '********'             # Not used with sqlite3.
+    DATABASE_PASSWORD = '*********'        # Not used with sqlite3.
+    DATABASE_HOST = '****************'      # Set to empty string for localhost. Not used with sqlite3.
+    DATABASE_PORT = '****'             # Set to empty string for default. Not used with sqlite3.
 
 
 
 ADMIN_MEDIA_PREFIX = '/djangomedia/'
 
 # Make this unique, and don't share it with anybody.
-SECRET_KEY = '..................................................'
+SECRET_KEY = '**************************************************'
 
 # List of callables that know how to import templates from various sources.
 TEMPLATE_LOADERS = (
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.middleware.locale.LocaleMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
+    #'lib.userprofile.UrlLocal',
+    #'lib.userprofile.ProfilingUser',
 )
 
 #TEMPLATE_CONTEXT_PROCESSORS = (

templates/invoices/index.html

 
                 {% if invoiceheader.status == 'D' %}
                     <td> <a href="{% url invoices-update invoiceheader.id%}"> {%trans "Update" %} </a> </td>
-                    <td> <a href="{% url invoices-pdfhtml invoiceheader.id%}">{%trans "pdf" %}</a></td>
-                    <td> <a href="{% url invoices-delete invoiceheader.id%}">{%trans "delete" %}</a></td>
+                    <td> <a href="{% url invoices-pdfhtml invoiceheader.id%}">{%trans "pdf" %} </a> </td>
+                    <td> <a href="{% url invoices-delete invoiceheader.id%}">{%trans "delete" %} </a> </td>
                 {% else %}
                     <td>&nbsp;</td>
                     <td> <label href="{% url invoices-download invoiceheader.id%}">{%trans "pdf" %}</label></td>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.