Пример #1
0
"""
Copyright (C) 2013 Michael Davidsaver
Licensed under AGPL 3+
See file "LICENSE" for full terms
"""

from django.conf import settings
from django.conf.urls import patterns, url
from django.conf.urls.static import static
from django.core.urlresolvers import reverse_lazy
from django.shortcuts import get_object_or_404
from django.views.generic import CreateView, UpdateView, DetailView, ListView, DeleteView

import djapian
djapian.load_indexes()

from inventory.models import Vendor, Part, Supply, Info, VendorForm, PartForm, SupplyForm, InfoForm


class PartObjectMixin(object):
    model = Part
    form_class = PartForm

    def get_object(self, queryset=None):
        if queryset is None:
            queryset = self.get_queryset()
        return get_object_or_404(queryset,
                                 oem__name=self.kwargs['oem'],
                                 partnum=self.kwargs['partnum'])

Пример #2
0
from django.conf.urls.defaults import *

urlpatterns = patterns(
    'sphene.sphsearchboard.views',
    url(r'^$', 'view_search_posts', name='sphsearchboard_posts'),
)
try:
    from djapian import load_indexes
    load_indexes()
except:
    pass
Пример #3
0
from django.conf.urls import patterns, include

# Admin backend
from django.contrib import admin
admin.autodiscover()

import djapian
djapian.load_indexes()

urlpatterns = patterns('',
	# Example:
	# (r'^demozoo2/', include('demozoo2.foo.urls')),

	# 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/', include(admin.site.urls)),

	(r'^account/$', 'demoscene.views.accounts.index', {}, 'account_index'),
	(r'^account/login/$', 'django.contrib.auth.views.login', {}, 'log_in'),
	(r'^account/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, 'log_out'),
	(r'^account/signup/$', 'demoscene.views.accounts.signup', {}, 'user_signup'),
	(r'^account/change_password/$', 'demoscene.views.accounts.change_password', {}, 'account_change_password'),
	# forgotten password
	(r'^account/forgotten_password/$', 'django.contrib.auth.views.password_reset', {'is_admin_site': False}, 'password_reset'),
	(r'^account/forgotten_password/success/$', 'django.contrib.auth.views.password_reset_done', {}, 'password_reset_done'),
	(r'^account/forgotten_password/check/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>\w+-\w+)/$', 'django.contrib.auth.views.password_reset_confirm', {}, 'password_reset_confirm'),

	# temporary route for password reset emails sent prior to django 1.6
	(r'^account/forgotten_password/confirm/(?P<uidb36>\w+)/(?P<token>\w+-\w+)/$', 'django.contrib.auth.views.password_reset_confirm_uidb36', {}),
Пример #4
0
from django.conf.urls.defaults import *


urlpatterns = patterns('sphene.sphsearchboard.views',
                       url(r'^$', 'view_search_posts', name = 'sphsearchboard_posts'),)
try:
    from djapian import load_indexes
    load_indexes()
except:
    pass