Removed several references to edbob
.
This commit is contained in:
parent
578e4bde2a
commit
68650a5488
|
@ -93,7 +93,7 @@ def get_sort_map(cls, names=None, **kwargs):
|
||||||
def render_grid(grid, search_form=None, **kwargs):
|
def render_grid(grid, search_form=None, **kwargs):
|
||||||
"""
|
"""
|
||||||
Convenience function to render ``grid`` (which should be a
|
Convenience function to render ``grid`` (which should be a
|
||||||
:class:`edbob.pyramid.grids.Grid` instance).
|
:class:`rattail.pyramid.grids.Grid` instance).
|
||||||
|
|
||||||
This "usually" will return a dictionary to be used as context for rendering
|
This "usually" will return a dictionary to be used as context for rendering
|
||||||
the final view template.
|
the final view template.
|
||||||
|
|
|
@ -26,19 +26,12 @@
|
||||||
``rattail.pyramid.views`` -- Pyramid Views
|
``rattail.pyramid.views`` -- Pyramid Views
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from rattail.pyramid.views.core import *
|
||||||
|
from rattail.pyramid.views.grids import *
|
||||||
from rattail.pyramid.views.crud import *
|
from rattail.pyramid.views.crud import *
|
||||||
from rattail.pyramid.views.autocomplete import *
|
from rattail.pyramid.views.autocomplete import *
|
||||||
|
|
||||||
|
|
||||||
class View(object):
|
|
||||||
"""
|
|
||||||
Base for all class-based views.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, request):
|
|
||||||
self.request = request
|
|
||||||
|
|
||||||
|
|
||||||
def includeme(config):
|
def includeme(config):
|
||||||
config.include('rattail.pyramid.views.batches')
|
config.include('rattail.pyramid.views.batches')
|
||||||
# config.include('rattail.pyramid.views.categories')
|
# config.include('rattail.pyramid.views.categories')
|
||||||
|
|
|
@ -26,8 +26,8 @@
|
||||||
``rattail.pyramid.views.autocomplete`` -- Autocomplete View
|
``rattail.pyramid.views.autocomplete`` -- Autocomplete View
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from edbob.pyramid.views import View
|
from rattail.pyramid.views import View
|
||||||
from edbob.pyramid import Session
|
from rattail.pyramid import Session
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['AutocompleteView']
|
__all__ = ['AutocompleteView']
|
||||||
|
|
|
@ -31,15 +31,15 @@ from pyramid.renderers import render_to_response
|
||||||
|
|
||||||
from webhelpers.html import tags
|
from webhelpers.html import tags
|
||||||
|
|
||||||
import edbob
|
from edbob.pyramid.forms import PrettyDateTimeFieldRenderer
|
||||||
from edbob.pyramid import Session
|
from rattail.pyramid.forms import EnumFieldRenderer
|
||||||
from edbob.pyramid.forms import EnumFieldRenderer, PrettyDateTimeFieldRenderer
|
from rattail.pyramid.grids.search import BooleanSearchFilter
|
||||||
from edbob.pyramid.grids.search import BooleanSearchFilter
|
|
||||||
from edbob.pyramid.progress import SessionProgress
|
from edbob.pyramid.progress import SessionProgress
|
||||||
from edbob.pyramid.views import SearchableAlchemyGridView, CrudView, View
|
from rattail.pyramid.views import SearchableAlchemyGridView, CrudView, View
|
||||||
|
|
||||||
import rattail
|
import rattail
|
||||||
from rattail import batches
|
from rattail import batches
|
||||||
|
from rattail.pyramid import Session
|
||||||
from rattail.db.model import Batch
|
from rattail.db.model import Batch
|
||||||
from rattail.threads import Thread
|
from rattail.threads import Thread
|
||||||
|
|
||||||
|
@ -140,7 +140,8 @@ class BatchCrud(CrudView):
|
||||||
class ExecuteBatch(View):
|
class ExecuteBatch(View):
|
||||||
|
|
||||||
def execute_batch(self, batch, progress):
|
def execute_batch(self, batch, progress):
|
||||||
session = edbob.Session()
|
from rattail.db import Session
|
||||||
|
session = Session()
|
||||||
batch = session.merge(batch)
|
batch = session.merge(batch)
|
||||||
|
|
||||||
if not batch.execute(progress):
|
if not batch.execute(progress):
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
``rattail.pyramid.views.batches.params`` -- Batch Parameter Views
|
``rattail.pyramid.views.batches.params`` -- Batch Parameter Views
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from edbob.pyramid.views import View
|
from rattail.pyramid.views import View
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['BatchParamsView']
|
__all__ = ['BatchParamsView']
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
``rattail.pyramid.views.batches.params.printlabels`` -- Print Labels Batch
|
``rattail.pyramid.views.batches.params.printlabels`` -- Print Labels Batch
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from edbob.pyramid import Session
|
from rattail.pyramid import Session
|
||||||
|
|
||||||
import rattail
|
import rattail
|
||||||
from rattail.pyramid.views.batches.params import BatchParamsView
|
from rattail.pyramid.views.batches.params import BatchParamsView
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
|
|
||||||
from pyramid.httpexceptions import HTTPFound
|
from pyramid.httpexceptions import HTTPFound
|
||||||
|
|
||||||
from edbob.pyramid import Session
|
from rattail.pyramid import Session
|
||||||
from edbob.pyramid.views import SearchableAlchemyGridView, CrudView
|
from rattail.pyramid.views import SearchableAlchemyGridView, CrudView
|
||||||
|
|
||||||
import rattail
|
import rattail
|
||||||
from rattail.pyramid.forms import GPCFieldRenderer
|
from rattail.pyramid.forms import GPCFieldRenderer
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
``rattail.pyramid.views.brands`` -- Brand Views
|
``rattail.pyramid.views.brands`` -- Brand Views
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from edbob.pyramid.views import (
|
from rattail.pyramid.views import (
|
||||||
SearchableAlchemyGridView, CrudView, AutocompleteView)
|
SearchableAlchemyGridView, CrudView, AutocompleteView)
|
||||||
|
|
||||||
from rattail.db.model import Brand
|
from rattail.db.model import Brand
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
``rattail.pyramid.views.categories`` -- Category Views
|
``rattail.pyramid.views.categories`` -- Category Views
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from edbob.pyramid.views import SearchableAlchemyGridView, CrudView
|
from rattail.pyramid.views import SearchableAlchemyGridView, CrudView
|
||||||
|
|
||||||
from rattail.db.model import Category
|
from rattail.db.model import Category
|
||||||
|
|
||||||
|
|
35
rattail/pyramid/views/core.py
Normal file
35
rattail/pyramid/views/core.py
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# Rattail -- Retail Software Framework
|
||||||
|
# Copyright © 2010-2012 Lance Edgar
|
||||||
|
#
|
||||||
|
# This file is part of Rattail.
|
||||||
|
#
|
||||||
|
# Rattail is free software: you can redistribute it and/or modify it under the
|
||||||
|
# terms of the GNU Affero General Public License as published by the Free
|
||||||
|
# Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# Rattail is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
|
||||||
|
# more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with Rattail. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
"""
|
||||||
|
``rattail.pyramid.views.core`` -- Core View
|
||||||
|
"""
|
||||||
|
|
||||||
|
class View(object):
|
||||||
|
"""
|
||||||
|
Base for all class-based views.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, request):
|
||||||
|
self.request = request
|
|
@ -30,9 +30,9 @@ from pyramid.httpexceptions import HTTPFound
|
||||||
|
|
||||||
import formalchemy
|
import formalchemy
|
||||||
|
|
||||||
from edbob.pyramid import Session
|
from rattail.pyramid import Session
|
||||||
from edbob.pyramid.forms.formalchemy import AlchemyForm
|
from edbob.pyramid.forms.formalchemy import AlchemyForm
|
||||||
from edbob.pyramid.views.core import View
|
from rattail.pyramid.views.core import View
|
||||||
from edbob.util import requires_impl, prettify
|
from edbob.util import requires_impl, prettify
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,9 +26,8 @@
|
||||||
``rattail.pyramid.views.customergroups`` -- CustomerGroup Views
|
``rattail.pyramid.views.customergroups`` -- CustomerGroup Views
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from edbob.pyramid.views import SearchableAlchemyGridView
|
from rattail.pyramid.views import SearchableAlchemyGridView, CrudView
|
||||||
|
|
||||||
from rattail.pyramid.views import CrudView
|
|
||||||
from rattail.pyramid import Session
|
from rattail.pyramid import Session
|
||||||
from rattail.db.model import CustomerGroup, CustomerGroupAssignment
|
from rattail.db.model import CustomerGroup, CustomerGroupAssignment
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,10 @@
|
||||||
|
|
||||||
from sqlalchemy import and_
|
from sqlalchemy import and_
|
||||||
|
|
||||||
import edbob
|
from edbob.enum import EMAIL_PREFERENCE
|
||||||
from edbob.pyramid.views import SearchableAlchemyGridView
|
|
||||||
from edbob.pyramid.forms import EnumFieldRenderer
|
from rattail.pyramid.views import SearchableAlchemyGridView
|
||||||
|
from rattail.pyramid.forms import EnumFieldRenderer
|
||||||
|
|
||||||
import rattail
|
import rattail
|
||||||
from rattail.pyramid import Session
|
from rattail.pyramid import Session
|
||||||
|
@ -126,7 +127,7 @@ class CustomerCrud(CrudView):
|
||||||
|
|
||||||
def fieldset(self, model):
|
def fieldset(self, model):
|
||||||
fs = self.make_fieldset(model)
|
fs = self.make_fieldset(model)
|
||||||
fs.email_preference.set(renderer=EnumFieldRenderer(edbob.EMAIL_PREFERENCE))
|
fs.email_preference.set(renderer=EnumFieldRenderer(EMAIL_PREFERENCE))
|
||||||
fs.configure(
|
fs.configure(
|
||||||
include=[
|
include=[
|
||||||
fs.id.label("ID"),
|
fs.id.label("ID"),
|
||||||
|
|
|
@ -27,9 +27,9 @@
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
from edbob.pyramid.views import SearchableAlchemyGridView, CrudView, AlchemyGridView
|
from rattail.pyramid.views import (
|
||||||
|
SearchableAlchemyGridView, CrudView, AlchemyGridView, AutocompleteView)
|
||||||
|
|
||||||
from rattail.pyramid.views import AutocompleteView
|
|
||||||
from rattail.db.model import Department, Product, ProductCost, Vendor
|
from rattail.db.model import Department, Product, ProductCost, Vendor
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,7 @@
|
||||||
|
|
||||||
from sqlalchemy import and_
|
from sqlalchemy import and_
|
||||||
|
|
||||||
from edbob.pyramid.views import SearchableAlchemyGridView
|
from rattail.pyramid.views import SearchableAlchemyGridView, CrudView
|
||||||
|
|
||||||
from rattail.pyramid.views import CrudView
|
|
||||||
from rattail.pyramid.grids.search import EnumSearchFilter
|
from rattail.pyramid.grids.search import EnumSearchFilter
|
||||||
from rattail.pyramid.forms import AssociationProxyField, EnumFieldRenderer
|
from rattail.pyramid.forms import AssociationProxyField, EnumFieldRenderer
|
||||||
from rattail.db.model import (
|
from rattail.db.model import (
|
||||||
|
|
|
@ -32,9 +32,9 @@ import formalchemy
|
||||||
|
|
||||||
from webhelpers.html import HTML
|
from webhelpers.html import HTML
|
||||||
|
|
||||||
from edbob.pyramid import Session
|
from rattail.pyramid import Session
|
||||||
from edbob.pyramid.views import SearchableAlchemyGridView, CrudView
|
from rattail.pyramid.views import SearchableAlchemyGridView, CrudView
|
||||||
from edbob.pyramid.grids.search import BooleanSearchFilter
|
from rattail.pyramid.grids.search import BooleanSearchFilter
|
||||||
from edbob.pyramid.forms import StrippingFieldRenderer
|
from edbob.pyramid.forms import StrippingFieldRenderer
|
||||||
|
|
||||||
from rattail.db.model import LabelProfile
|
from rattail.db.model import LabelProfile
|
||||||
|
|
|
@ -28,9 +28,9 @@
|
||||||
|
|
||||||
from sqlalchemy import and_
|
from sqlalchemy import and_
|
||||||
|
|
||||||
from edbob.pyramid.views import SearchableAlchemyGridView
|
from rattail.pyramid.views import (
|
||||||
|
SearchableAlchemyGridView, CrudView, AutocompleteView)
|
||||||
|
|
||||||
from rattail.pyramid.views import CrudView, AutocompleteView
|
|
||||||
from rattail.pyramid import Session
|
from rattail.pyramid import Session
|
||||||
from rattail.db.model import (Person, PersonEmailAddress, PersonPhoneNumber,
|
from rattail.db.model import (Person, PersonEmailAddress, PersonPhoneNumber,
|
||||||
VendorContact)
|
VendorContact)
|
||||||
|
|
|
@ -36,7 +36,7 @@ from pyramid.renderers import render_to_response
|
||||||
|
|
||||||
import edbob
|
import edbob
|
||||||
from edbob.pyramid.progress import SessionProgress
|
from edbob.pyramid.progress import SessionProgress
|
||||||
from edbob.pyramid.views import SearchableAlchemyGridView
|
from rattail.pyramid.views import SearchableAlchemyGridView
|
||||||
|
|
||||||
import rattail.labels
|
import rattail.labels
|
||||||
from rattail import sil
|
from rattail import sil
|
||||||
|
@ -268,7 +268,8 @@ def print_labels(request):
|
||||||
class CreateProductsBatch(ProductsGrid):
|
class CreateProductsBatch(ProductsGrid):
|
||||||
|
|
||||||
def make_batch(self, provider, progress):
|
def make_batch(self, provider, progress):
|
||||||
session = edbob.Session()
|
from rattail.db import Session
|
||||||
|
session = Session()
|
||||||
|
|
||||||
self._filter_config = self.filter_config()
|
self._filter_config = self.filter_config()
|
||||||
self._sort_config = self.sort_config()
|
self._sort_config = self.sort_config()
|
||||||
|
|
|
@ -1,7 +1,29 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# Rattail -- Retail Software Framework
|
||||||
|
# Copyright © 2010-2012 Lance Edgar
|
||||||
|
#
|
||||||
|
# This file is part of Rattail.
|
||||||
|
#
|
||||||
|
# Rattail is free software: you can redistribute it and/or modify it under the
|
||||||
|
# terms of the GNU Affero General Public License as published by the Free
|
||||||
|
# Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# Rattail is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
|
||||||
|
# more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with Rattail. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
"""
|
"""
|
||||||
``dtail.views.reports`` -- Report Views
|
``rattail.pyramid.views.reports`` -- Report Views
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
@ -13,10 +35,11 @@ from mako.template import Template
|
||||||
from pyramid.response import Response
|
from pyramid.response import Response
|
||||||
|
|
||||||
import edbob
|
import edbob
|
||||||
from edbob.pyramid import Session
|
from edbob.time import local_time
|
||||||
from edbob.files import resource_path
|
|
||||||
|
|
||||||
import rattail
|
import rattail
|
||||||
|
from rattail.pyramid import Session
|
||||||
|
from rattail.files import resource_path
|
||||||
|
|
||||||
|
|
||||||
plu_upc_pattern = re.compile(r'^000000000(\d{5})$')
|
plu_upc_pattern = re.compile(r'^000000000(\d{5})$')
|
||||||
|
@ -69,7 +92,7 @@ def write_inventory_worksheet(request, department):
|
||||||
q = q.order_by(rattail.Brand.name, rattail.Product.description)
|
q = q.order_by(rattail.Brand.name, rattail.Product.description)
|
||||||
return q.all()
|
return q.all()
|
||||||
|
|
||||||
now = edbob.local_time()
|
now = local_time()
|
||||||
data = dict(
|
data = dict(
|
||||||
date=now.strftime('%a %d %b %Y'),
|
date=now.strftime('%a %d %b %Y'),
|
||||||
time=now.strftime('%I:%M %p'),
|
time=now.strftime('%I:%M %p'),
|
||||||
|
@ -134,7 +157,7 @@ def write_ordering_worksheet(vendor, departments, preferred_only):
|
||||||
key = '{0} {1}'.format(brand, product.description)
|
key = '{0} {1}'.format(brand, product.description)
|
||||||
return key
|
return key
|
||||||
|
|
||||||
now = edbob.local_time()
|
now = local_time()
|
||||||
data = dict(
|
data = dict(
|
||||||
vendor=vendor,
|
vendor=vendor,
|
||||||
costs=costs,
|
costs=costs,
|
||||||
|
|
|
@ -28,9 +28,7 @@
|
||||||
|
|
||||||
from sqlalchemy import and_
|
from sqlalchemy import and_
|
||||||
|
|
||||||
from edbob.pyramid.views import SearchableAlchemyGridView
|
from rattail.pyramid.views import SearchableAlchemyGridView, CrudView
|
||||||
|
|
||||||
from rattail.pyramid.views import CrudView
|
|
||||||
from rattail.db.model import Store, StoreEmailAddress, StorePhoneNumber
|
from rattail.db.model import Store, StoreEmailAddress, StorePhoneNumber
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
``rattail.pyramid.views.subdepartments`` -- Subdepartment Views
|
``rattail.pyramid.views.subdepartments`` -- Subdepartment Views
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from edbob.pyramid.views import SearchableAlchemyGridView, CrudView
|
from rattail.pyramid.views import SearchableAlchemyGridView, CrudView
|
||||||
|
|
||||||
from rattail.db.model import Subdepartment
|
from rattail.db.model import Subdepartment
|
||||||
|
|
||||||
|
|
|
@ -26,11 +26,10 @@
|
||||||
``rattail.pyramid.views.vendors`` -- Vendor Views
|
``rattail.pyramid.views.vendors`` -- Vendor Views
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from edbob.pyramid.views import SearchableAlchemyGridView
|
from rattail.pyramid.views import (
|
||||||
|
SearchableAlchemyGridView, CrudView, AutocompleteView)
|
||||||
from rattail.db.model import Vendor
|
|
||||||
from rattail.pyramid.views import CrudView, AutocompleteView
|
|
||||||
from rattail.pyramid.forms import AssociationProxyField, PersonFieldRenderer
|
from rattail.pyramid.forms import AssociationProxyField, PersonFieldRenderer
|
||||||
|
from rattail.db.model import Vendor
|
||||||
|
|
||||||
|
|
||||||
class VendorsGrid(SearchableAlchemyGridView):
|
class VendorsGrid(SearchableAlchemyGridView):
|
||||||
|
|
Loading…
Reference in a new issue