# Path: partners/models.py
# class Partner(models.Model):
# 	
# 	name = models.CharField(max_length=100)
# 	description = models.TextField()
# 	address = models.TextField()
# 	fone = models.CharField(max_length=12)
# 
# 	def save_patners(self, partner_name, partner_description, partner_address, partner_fone):
# 		partner = Partner(name=partner_name, description = partner_description, address = partner_address, fone = partner_fone)
# 		partner.save()
# 		
# 	
# 	def __str__(self):
#                 return self.name


from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.core.urlresolvers import reverse
from django.http import Http404
from .models import Partner
    return resultCheck

def check_name(name, tamanho):
    if len(name) >= tamanho:
        return ''
    else:
        return 'Nome deve conter apenas letras e deve ter no minimo de ' + str(tamanho) + ' caracteres'

def check_description(description, tamanho):
    if len(description) >= tamanho:
        return ''
    else:
        return 'Descricao deve ter no minimo de ' + str(tamanho) + ' caracteres'

def check_address(address, tamanho):
    if len(address) >= tamanho:
        return ''
    else:
        return 'Endereco deve ter no minimo de ' + str(tamanho) + ' caracteres'

def check_fone(fone, tamanho):
    if len(fone) >= tamanho and not fone.isalpha():
        return ''
    else:
        return 'fone deve ter no minimo de ' + str(tamanho) + ' caracteres'



def list_partners(request):
    context = {

# Path: partners/models.py
# class Partner(models.Model):
# 	
# 	name = models.CharField(max_length=100)
# 	description = models.TextField()
# 	address = models.TextField()
# 	fone = models.CharField(max_length=12)
# 
# 	def save_patners(self, partner_name, partner_description, partner_address, partner_fone):
# 		partner = Partner(name=partner_name, description = partner_description, address = partner_address, fone = partner_fone)
# 		partner.save()
# 		
# 	
# 	def __str__(self):
#                 return self.name


# Path: partners/views.py
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.core.urlresolvers import reverse
from django.http import Http404
from .models import Partner

    return resultCheck

def check_name(name, tamanho):
    if len(name) >= tamanho:
        return ''
    else:
        return 'Nome deve conter apenas letras e deve ter no minimo de ' + str(tamanho) + ' caracteres'

def check_description(description, tamanho):
    if len(description) >= tamanho:
        return ''
    else:
        return 'Descricao deve ter no minimo de ' + str(tamanho) + ' caracteres'

def check_address(address, tamanho):
    if len(address) >= tamanho:
        return ''
    else:
        return 'Endereco deve ter no minimo de ' + str(tamanho) + ' caracteres'

def check_fone(fone, tamanho):
    if len(fone) >= tamanho and not fone.isalpha():
        return ''
    else:
        return 'fone deve ter no minimo de ' + str(tamanho) + ' caracteres'



def list_partners(request):
    context = {

                'all_partners': Partner.objects.all(),