Esempio n. 1
0
File: shop.py Progetto: hforge/shop
 def _make_resource(cls, folder, name, *args, **kw):
     root = ShopFolder._make_resource(cls, folder, name, **kw)
     # Payments module
     cls.payments_class._make_resource(cls.payments_class, folder,
                             '%s/payments' % name,
                             title={'en': u'Payment module'})
     # Modules
     Modules._make_resource(Modules, folder,
                   '%s/modules' % name, title={'en': u'Modules'})
     # Suppliers
     Suppliers._make_resource(Suppliers, folder,
                   '%s/suppliers' % name, title={'en': u'Suppliers'})
     # Customers
     Customers._make_resource(Customers, folder,
                   '%s/customers' % name, title={'en': u'Customers'})
     # Product Models
     ProductModels._make_resource(ProductModels, folder, '%s/products-models' % name,
                                 title={'en': u'Product Models'})
     # Orders
     Orders._make_resource(Orders, folder, '%s/orders' % name,
                           title={'en': u'Orders'})
     # ShopUser_Groups
     ShopUser_Groups._make_resource(ShopUser_Groups, folder, '%s/groups' % name,
                                     title={'en': u'User groups'})
     # Addresses
     Addresses._make_resource(Addresses, folder, '%s/addresses' % name,
                              title={'en': u'Addresses'})
     # Countries
     Countries._make_resource(Countries, folder, '%s/countries' % name,
                              title={'en': u'countries'})
     # Countries zone
     CountriesZones._make_resource(CountriesZones, folder,
             '%s/countries-zones' % name, title={'en': u'Countries Zones'})
     # EnumeratesFolder
     EnumeratesFolder._make_resource(EnumeratesFolder, folder,
                                 '%s/enumerates' % name, title={'en': u'Enumerates'})
     # Shipping
     Shippings._make_resource(Shippings, folder, '%s/shippings' % name,
                              title={'en': u'Shipping'})
     # Conditions of users
     WebPage._make_resource(WebPage, folder, '%s/terms-and-conditions-of-use' % name,
                             **{'title': {'fr': u'Conditions Générales de ventes',
                                          'en': u'Terms and conditions of user'},
                                'state': 'public'})
     # Default cross Selling configuration
     CrossSellingTable._make_resource(CrossSellingTable, folder,
                                      '%s/cross-selling' % name,
                                      title={'en': u'Cross selling'})
     # Taxes
     Taxes_TableResource._make_resource(Taxes_TableResource, folder, '%s/taxes' % name,
                             **{'title': {'fr': u'TVA',
                                          'en': u'Taxes'}})
     table = Taxes_TableHandler()
     table.add_record({'value': '19.6'})
     folder.set_handler('%s/taxes' % name, table)
Esempio n. 2
0
class Post(WebPage):

    class_id = 'blog-post'
    class_title = MSG(u'Blog Post')
    class_description = MSG(u'Create and publish Post')
    class_icon16 = 'blog/Blog16.png'
    class_icon48 = 'blog/Blog48.png'
    class_views = ['view', 'edit', 'commit_log']

    # Fields
    date = Date_Field(stored=True, title=MSG(u'Date'))
    title = WebPage.title(required=True)
    data = WebPage.data(widget=rte)

    # Views
    new_instance = Post_NewInstance
    view = Post_View
    edit = File_Edit(fields=['title', 'date', 'data', 'share'])
Esempio n. 3
0
 def _make_resource(cls, folder, name, ctime=None, *args, **kw):
     ShopModule._make_resource(cls, folder, name, ctime=ctime, *args, **kw)
     kw = {'title': {'en': 'CGU'}, 'state': 'public'}
     WebPage._make_resource(WebPage, folder, '%s/cgu' % name, **kw)
     Folder._make_resource(Folder, folder, '%s/images' % name)
Esempio n. 4
0
 def _make_resource(cls, folder, name, *args, **kw):
     root = ShopFolder._make_resource(cls, folder, name, **kw)
     # Payments module
     cls.payments_class._make_resource(cls.payments_class,
                                       folder,
                                       '%s/payments' % name,
                                       title={'en': u'Payment module'})
     # Modules
     Modules._make_resource(Modules,
                            folder,
                            '%s/modules' % name,
                            title={'en': u'Modules'})
     # Suppliers
     Suppliers._make_resource(Suppliers,
                              folder,
                              '%s/suppliers' % name,
                              title={'en': u'Suppliers'})
     # Customers
     Customers._make_resource(Customers,
                              folder,
                              '%s/customers' % name,
                              title={'en': u'Customers'})
     # Product Models
     ProductModels._make_resource(ProductModels,
                                  folder,
                                  '%s/products-models' % name,
                                  title={'en': u'Product Models'})
     # Orders
     Orders._make_resource(Orders,
                           folder,
                           '%s/orders' % name,
                           title={'en': u'Orders'})
     # ShopUser_Groups
     ShopUser_Groups._make_resource(ShopUser_Groups,
                                    folder,
                                    '%s/groups' % name,
                                    title={'en': u'User groups'})
     # Addresses
     Addresses._make_resource(Addresses,
                              folder,
                              '%s/addresses' % name,
                              title={'en': u'Addresses'})
     # Countries
     Countries._make_resource(Countries,
                              folder,
                              '%s/countries' % name,
                              title={'en': u'countries'})
     # Countries zone
     CountriesZones._make_resource(CountriesZones,
                                   folder,
                                   '%s/countries-zones' % name,
                                   title={'en': u'Countries Zones'})
     # EnumeratesFolder
     EnumeratesFolder._make_resource(EnumeratesFolder,
                                     folder,
                                     '%s/enumerates' % name,
                                     title={'en': u'Enumerates'})
     # Shipping
     Shippings._make_resource(Shippings,
                              folder,
                              '%s/shippings' % name,
                              title={'en': u'Shipping'})
     # Conditions of users
     WebPage._make_resource(
         WebPage, folder, '%s/terms-and-conditions-of-use' % name, **{
             'title': {
                 'fr': u'Conditions Générales de ventes',
                 'en': u'Terms and conditions of user'
             },
             'state': 'public'
         })
     # Default cross Selling configuration
     CrossSellingTable._make_resource(CrossSellingTable,
                                      folder,
                                      '%s/cross-selling' % name,
                                      title={'en': u'Cross selling'})
     # Taxes
     Taxes_TableResource._make_resource(
         Taxes_TableResource, folder, '%s/taxes' % name,
         **{'title': {
             'fr': u'TVA',
             'en': u'Taxes'
         }})
     table = Taxes_TableHandler()
     table.add_record({'value': '19.6'})
     folder.set_handler('%s/taxes' % name, table)
Esempio n. 5
0
 def update_relative_links(self, source):
     BaseWebPage.update_relative_links(self, source)
     TagsAware.update_relative_links(self, source)
Esempio n. 6
0
 def update_links(self, source, target):
     BaseWebPage.update_links(self, source, target)
     TagsAware.update_links(self, source, target)
Esempio n. 7
0
 def get_links(self):
     links = BaseWebPage.get_links(self)
     links.update(TagsAware.get_links(self))
     return links
Esempio n. 8
0
 def get_catalog_values(self):
     return merge_dicts(BaseWebPage.get_catalog_values(self),
                        TagsAware.get_catalog_values(self))
Esempio n. 9
0
 def _make_resource(cls, folder, name, ctime=None, *args, **kw):
     ShopModule._make_resource(cls, folder, name, ctime=ctime, *args, **kw)
     kw = {'title': {'en': 'CGU'},
           'state': 'public'}
     WebPage._make_resource(WebPage, folder, '%s/cgu' % name, **kw)
     Folder._make_resource(Folder, folder, '%s/images' % name)