Commits

Anonymous committed 0c381ef

removed company model

Comments (0)

Files changed (6)

company/__init__.py

Empty file removed.

company/forms.py

-from django import forms
-from company.models import Company
-		
-class SignUpCompanyForm(forms.ModelForm):
-	class Meta:
-		model = Company;
-		exclude = ['id', 'date_added', 'approved'];

company/models.py

-from django.db import models
-
-# Create your models here.
-class Company(models.Model):
-	id = models.AutoField(primary_key=True);
-	name = models.CharField(max_length=100, null=True);
-	address = models.CharField(max_length=100, null=True);
-	phone = models.CharField(max_length=15, null=True);
-	website = models.CharField(max_length=50, null=True);
-	email = models.EmailField(max_length=50, null=True);
-	hiring = models.BooleanField(default=False);	
-	approved = models.BooleanField(default=False);
-	date_added = models.DateTimeField(auto_now_add=True);
-	about_us = models.TextField(max_length=500, null=True);

company/tests.py

-"""
-This file demonstrates writing tests using the unittest module. These will pass
-when you run "manage.py test".
-
-Replace this 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.assertEqual(1 + 1, 2)

company/views.py

-from django.core.cache import cache
-from django.contrib.auth.forms import UserCreationForm
-from django.views.generic.simple import direct_to_template
-from django.http import HttpResponseRedirect
-from django.views.generic.simple import direct_to_template
-from company.forms import SignUpCompanyForm
-from company.models import Company
-
-# Create your views here.
-def sign_up_form(request):
-	return direct_to_template(request, 'sign_up.html', {'form': SignUpCompanyForm()} );
-	
-def sign_up(request):
-	if request.method == 'POST':
-		form = SignUpCompanyForm(request.POST);
-		if form.is_valid():
-			company = form.save(commit=False);
-			company.save();
-			
-	return HttpResponseRedirect('/confirmation');
-	
-def results(request):
-	company = Company.objects.all().order_by('id')[:5];
-	
-	return direct_to_template(request, 'results.html', {'company': company} );
-	
-def nytm_page(request):
-	company = Company.objects.all().order_by('id')[:5];
-	
-	return direct_to_template(request, 'nytm.html', {'company': company} );

templates/results.html

-{% extends 'base.html' %}
-
-{% block title %}NY Tech Map{% endblock %}
-
-{% block css %}
-	<link rel="stylesheet" href="/css/main.css" />	
-{% endblock %}
-	
-{% block content %}	
-	<div id="content">
-		<!-- the results page -->
-		{% for comp in company %}
-			<b>{{ comp.id }}</b><br/>
-		{% endfor %}
-	</div>
-{% endblock %}
-
-{% block js %}
-	<script type="text/javascript">
-		$(document).ready(function(){
-			var height = $(window).height();			
-			$('#content').css("height",height-100);			
-		});
-	</script>	
-{% endblock %}		
-