https://github.com/mdiep/django-contactable
A reusable django application for storing contact information
https://github.com/mdiep/django-contactable
Last synced: about 1 month ago
JSON representation
A reusable django application for storing contact information
- Host: GitHub
- URL: https://github.com/mdiep/django-contactable
- Owner: mdiep
- Created: 2010-09-13T00:18:38.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-10-10T22:01:59.000Z (over 14 years ago)
- Last Synced: 2025-03-29T05:11:38.813Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 117 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
# What is django-contactable?
django-contactable is a reusable Django application for storing contact information. It provides building blocks for larger, CRM applications.
# Synopsis
Model:
from django.db import models
from contactable.models import Contactable
class Person(Contactable):
name = models.CharField(max_length=50)Views:
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from contactable.forms import ContactInfoForm
def person_detail(request, id):
person = get_object_or_404(Person, id=id)
return render_to_response('detail template', locals())
def person_edit(request, id):
person = get_object_or_404(Person, id=id)
if request.method == 'POST':
form = ContactInfoForm(request.POST, instance=person)
if form.is_valid():
form.save()
return HttpResponseRedirect(person.get_absolute_url())
else:
form = ContactInfoForm(instance=person)
return render_to_response('edit template', locals())Detail Template:
{% load contactable %}
{% contact_info person %}Edit Template:
{{ form }}