# # reports/forms.py # # SVN/CVS Keywords # from django import forms from django.forms.formsets import formset_factory from inventory.apps.items.models import Item, Specification, Cost from inventory.apps.utils.widgets import TextDisplay, TextareaDisplay from inventory.settings import getLogger log = getLogger() class ItemForm(forms.Form): title = forms.CharField(max_length=248, label="Title:", widget=TextDisplay) item_number = forms.CharField(max_length=20, label="Item Number:", widget=TextDisplay) item_number_mfg = forms.CharField(max_length=20, label="MFG Item Number:", widget=TextDisplay) item_number_dst = forms.CharField(max_length=20, label="DST Item Number:", widget=TextDisplay) package = forms.CharField(max_length=30, label="Package:", widget=TextDisplay) condition = forms.CharField(max_length=6,
# login/forms.py # # SVN/CVS Info #---------------------------------- # $Author: cnobile $ # $Date: 2010-08-29 22:22:56 -0400 (Sun, 29 Aug 2010) $ # $Revision: 12 $ #---------------------------------- import re from django import forms from django.contrib.auth.models import User from inventory.settings import getLogger log = getLogger() class LoginForm(forms.Form): username = forms.CharField(max_length=30) password = forms.CharField(widget=forms.PasswordInput(render_value=False), max_length=30) class RegistrationForm(forms.Form): username = forms.CharField(label=u'Username', max_length=30) email = forms.EmailField(label=u'E-mail address') password1 = forms.CharField(widget=forms.PasswordInput(render_value=False), label=u'Password', max_length=128)
import datetime, pytz from django.http import HttpResponse from django.template import Context, loader from django.contrib.sessions.models import Session from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from inventory.apps.utils.views import ViewBase from inventory.apps.items.models import Distributor, Manufacturer from inventory.apps.regions.models import Country from inventory.settings import SITE_NAME, getLogger log = getLogger('inventory.views.items') class FrontPage(ViewBase): """ Called when the front page is requested. """ def __init__(self, log): super(FrontPage, self).__init__(log) def __call__(self, request, *args, **kwargs): response = {} username = request.user.username self._setBreadcrumb(request, 'Home', '/') self._log.info("SERVER_NAME: %s", request.get_host())