You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by gj...@apache.org on 2013/01/07 17:33:10 UTC
svn commit: r1429886 -
/incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/api.py
Author: gjm
Date: Mon Jan 7 16:33:10 2013
New Revision: 1429886
URL: http://svn.apache.org/viewvc?rev=1429886&view=rev
Log:
get schema out of each model instead of repeating the details in the MultiProductSystem component - towards #333 (from olemis)
Modified:
incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/api.py
Modified: incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/api.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/api.py?rev=1429886&r1=1429885&r2=1429886&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/api.py (original)
+++ incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/api.py Mon Jan 7 16:33:10 2013
@@ -31,7 +31,7 @@ from trac.ticket.api import ITicketField
from trac.util.translation import _, N_
from trac.web.chrome import ITemplateProvider
-from multiproduct.model import Product
+from multiproduct.model import Product, ProductResourceMap
DB_VERSION = 2
DB_SYSTEM_KEY = 'bloodhound_multi_product_version'
@@ -43,20 +43,8 @@ class MultiProductSystem(Component):
implements(IEnvironmentSetupParticipant, ITemplateProvider,
IPermissionRequestor, ITicketFieldProvider, IResourceManager)
- SCHEMA = [
- Table('bloodhound_product', key = ['prefix', 'name']) [
- Column('prefix'),
- Column('name'),
- Column('description'),
- Column('owner'),
- ],
- Table('bloodhound_productresourcemap', key = 'id') [
- Column('id', auto_increment=True),
- Column('product_id'),
- Column('resource_type'),
- Column('resource_id'),
- ]
- ]
+ SCHEMA = [mcls._get_schema() for mcls in (Product, ProductResourceMap)]
+ del mcls
def get_version(self):
"""Finds the current version of the bloodhound database schema"""