Commits

Rafael Jamur  committed cfb76aa

first release

  • Participants
  • Parent commits 74d5b23

Comments (0)

Files changed (13)

File ce/__init__.pyc

Binary file added.

File ce/estoque/__init__.py

Empty file added.

File ce/estoque/__init__.pyc

Binary file added.

File ce/estoque/admin.py

+from django.contrib import admin
+from estoque.models import *
+
+admin.site.register(Categoria)
+admin.site.register(Entrada)
+admin.site.register(Fornecedor)
+admin.site.register(Produto)
+admin.site.register(Retirante)
+admin.site.register(Saida)

File ce/estoque/admin.pyc

Binary file added.

File ce/estoque/models.py

+from django.db import models
+
+# Create your models here.
+# This is an auto-generated Django model module.
+# You'll have to do the following manually to clean this up:
+#     * Rearrange models' order
+#     * Make sure each model has one field with primary_key=True
+# Feel free to rename the models, but don't rename db_table values or field names.
+#
+# Also note: You'll have to insert the output of 'django-admin.py sqlcustom [appname]'
+# into your database.
+
+#from django.db import models
+
+class Categoria(models.Model):
+    id = models.IntegerField(primary_key=True)
+    nome = models.CharField(max_length=135, blank=True)
+    class Meta:
+        db_table = u'categoria'
+
+    def __unicode__(self):
+        return self.nome
+
+class Entrada(models.Model):
+    id = models.IntegerField(primary_key=True)
+    data = models.DateTimeField()
+    categoria = models.CharField(max_length=135)
+    produto = models.ForeignKey('Produto')
+    fornecedor = models.ForeignKey('Fornecedor')
+    quantidade = models.IntegerField()
+    obs = models.TextField()
+    class Meta:
+        db_table = u'entrada'
+
+    def __unicode__(self):
+        #return self.produto
+        return Produto.objects.get(id=self.produto)
+
+class Fornecedor(models.Model):
+    id = models.IntegerField(primary_key=True)
+    nome = models.TextField()
+    telefone = models.TextField(blank=True)
+    estado = models.TextField(blank=True)
+    cidade = models.TextField(blank=True)
+    class Meta:
+        db_table = u'fornecedor'
+
+    def __unicode__(self):
+        return self.nome
+
+class Produto(models.Model):
+    id = models.IntegerField(primary_key=True)
+    categoria = models.TextField(blank=True)
+    nome = models.TextField()
+    estoque_minimo = models.IntegerField()
+    estoque_atual = models.IntegerField()
+    class Meta:
+        db_table = u'produto'
+
+    def __unicode__(self):
+        return self.nome
+
+class Retirante(models.Model):
+    id = models.IntegerField(primary_key=True)
+    nome = models.TextField()
+    empresa = models.TextField()
+    class Meta:
+        db_table = u'retirante'
+
+    def __unicode__(self):
+        return self.nome
+
+class Saida(models.Model):
+    id = models.IntegerField(primary_key=True)
+    data = models.DateTimeField()
+    categoria = models.CharField(max_length=135)
+    produto = models.ForeignKey(Produto)
+    retirante = models.ForeignKey(Retirante)
+    quantidade = models.IntegerField()
+    obs = models.TextField()
+    class Meta:
+        db_table = u'saida'
+
+    def __unicode__(self):
+        return Produto.objects.get(id=self.produto)
+

File ce/estoque/models.pyc

Binary file added.

File ce/estoque/tests.py

+"""
+This file demonstrates two different styles of tests (one doctest and one
+unittest). These will both pass when you run "manage.py test".
+
+Replace these with more appropriate tests for your application.
+"""
+
+from django.test import TestCase
+
+class SimpleTest(TestCase):
+    def test_basic_addition(self):
+        """
+        Tests that 1 + 1 always equals 2.
+        """
+        self.failUnlessEqual(1 + 1, 2)
+
+__test__ = {"doctest": """
+Another way to test that 1 + 1 is equal to 2.
+
+>>> 1 + 1 == 2
+True
+"""}
+

File ce/estoque/views.py

+# Create your views here.

File ce/settings.py

 DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': 'controle-estoque',                      # Or path to database file if using sqlite3.
+        'NAME': 'controle_estoque',                      # Or path to database file if using sqlite3.
         'USER': 'ce',                      # Not used with sqlite3.
         'PASSWORD': 'ceteste',                  # Not used with sqlite3.
         'HOST': 'localhost',                      # Set to empty string for localhost. Not used with sqlite3.
 # timezone as the operating system.
 # If running in a Windows environment this must be set to the same as your
 # system time zone.
-TIME_ZONE = 'America/Chicago'
+TIME_ZONE = 'America/Sao_Paulo'
 
 # Language code for this installation. All choices can be found here:
 # http://www.i18nguy.com/unicode/language-identifiers.html
-LANGUAGE_CODE = 'en-us'
+LANGUAGE_CODE = 'pt-br'
 
 SITE_ID = 1
 
     'django.contrib.messages',
     # Uncomment the next line to enable the admin:
     # 'django.contrib.admin',
+    'django.contrib.admin',
+    'estoque',
 )

File ce/settings.pyc

Binary file added.
 from django.conf.urls.defaults import *
 
 # Uncomment the next two lines to enable the admin:
-# from django.contrib import admin
-# admin.autodiscover()
+from django.contrib import admin
+admin.autodiscover()
 
 urlpatterns = patterns('',
     # Example:
 
     # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
     # to INSTALLED_APPS to enable admin documentation:
-    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
+    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
 
     # Uncomment the next line to enable the admin:
-    # (r'^admin/', include(admin.site.urls)),
+    (r'^admin/', include(admin.site.urls)),
 )

File ce/urls.pyc

Binary file added.