# HG changeset patch # User Madhusudan C.S. # Date 1244302136 -7200 # Node ID bf70c5a0ef66728dc9cf8b9acf7b73397d28006d # Parent 5992e2033ca28c2bc7bac6a2d15baff96fb9f2a2 Added logic for every GHOP specific model. Defined logic for every model defined for GHOP. These logics do nothing special now. They are just inherited from their parent classes. Necessary GHOP specific logic will be added later as necessary. Reviewed by: Lennard de Rijk diff -r 5992e2033ca2 -r bf70c5a0ef66 app/soc/modules/ghop/logic/models/comment.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/modules/ghop/logic/models/comment.py Sat Jun 06 17:28:56 2009 +0200 @@ -0,0 +1,47 @@ +#!/usr/bin/python2.5 +# +# Copyright 2009 the Melange authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""GHOPComment (Model) query functions. +""" + +__authors__ = [ + '"Madhusudan.C.S" ' + ] + + +from soc.logic.models import comment +from soc.logic.models import linkable as linkable_logic + +import soc.models.comment + +from soc.modules.ghop.models import comment as ghop_comment_model + + +class Logic(comment.Logic): + """Logic methods for the GHOPComment model. + """ + + def __init__(self, model=ghop_comment_model.GHOPComment, + base_model=soc.models.comment.Comment, + scope_logic=linkable_logic): + """Defines the name, key_name and model for this entity. + """ + + super(Logic, self).__init__(model, base_model=base_model, + scope_logic=scope_logic) + + +logic = Logic() diff -r 5992e2033ca2 -r bf70c5a0ef66 app/soc/modules/ghop/logic/models/mentor.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/modules/ghop/logic/models/mentor.py Sat Jun 06 17:28:56 2009 +0200 @@ -0,0 +1,47 @@ +#!/usr/bin/python2.5 +# +# Copyright 2009 the Melange authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""GHOPMentor (Model) query functions. +""" + +__authors__ = [ + '"Madhusudan.C.S" ' + ] + + +from soc.logic.models import mentor + +import soc.models.mentor + +from soc.modules.ghop.logic.models import organization as ghop_org_logic +from soc.modules.ghop.models import mentor as ghop_mentor_model + + +class Logic(mentor.Logic): + """Logic methods for the GHOPMentor model. + """ + + def __init__(self, model=ghop_mentor_model.GHOPMentor, + base_model=soc.models.mentor.Mentor, + scope_logic=ghop_org_logic): + """Defines the name, key_name and model for this entity. + """ + + super(Logic, self).__init__(model, base_model=base_model, + scope_logic=scope_logic) + + +logic = Logic() diff -r 5992e2033ca2 -r bf70c5a0ef66 app/soc/modules/ghop/logic/models/org_admin.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/modules/ghop/logic/models/org_admin.py Sat Jun 06 17:28:56 2009 +0200 @@ -0,0 +1,47 @@ +#!/usr/bin/python2.5 +# +# Copyright 2009 the Melange authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""GHOPOrgAdmin (Model) query functions. +""" + +__authors__ = [ + '"Madhusudan.C.S" ' + ] + + +from soc.logic.models import org_admin + +import soc.models.org_admin + +from soc.modules.ghop.logic.models import organization as ghop_org_logic +from soc.modules.ghop.models import org_admin as ghop_org_admin_model + + +class Logic(org_admin.Logic): + """Logic methods for the GHOPOrgAdmin model. + """ + + def __init__(self, model=ghop_org_admin_model.GHOPOrgAdmin, + base_model=soc.models.org_admin.OrgAdmin, + scope_logic=ghop_org_logic): + """Defines the name, key_name and model for this entity. + """ + + super(Logic, self).__init__(model, base_model=base_model, + scope_logic=scope_logic) + + +logic = Logic() diff -r 5992e2033ca2 -r bf70c5a0ef66 app/soc/modules/ghop/logic/models/org_prize_assignment.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/modules/ghop/logic/models/org_prize_assignment.py Sat Jun 06 17:28:56 2009 +0200 @@ -0,0 +1,43 @@ +#!/usr/bin/python2.5 +# +# Copyright 2009 the Melange authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""GHOPOrgPrizeAssignment (Model) query functions. +""" + +__authors__ = [ + '"Madhusudan.C.S" ' + ] + + +from soc.logic.models import base + +from soc.modules.ghop.models import org_prize_assignment_model + + +class Logic(base.Logic): + """Logic methods for the GHOPOrgPrizeAssigment model. + """ + + def __init__(self, model=org_prize_assignment_model.GHOPOrgPrizeAssignment, + base_model=None, scope_logic=None): + """Defines the name, key_name and model for this entity. + """ + + super(Logic, self).__init__(model, base_model=base_model, + scope_logic=scope_logic, id_based=True) + + +logic = Logic() diff -r 5992e2033ca2 -r bf70c5a0ef66 app/soc/modules/ghop/logic/models/organization.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/modules/ghop/logic/models/organization.py Sat Jun 06 17:28:56 2009 +0200 @@ -0,0 +1,47 @@ +#!/usr/bin/python2.5 +# +# Copyright 2009 the Melange authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""GHOPOrganization (Model) query functions. +""" + +__authors__ = [ + '"Madhusudan.C.S" ' + ] + + +from soc.logic.models import organization + +import soc.models.organization + +from soc.modules.ghop.logic.models import program as ghop_program_logic +from soc.modules.ghop.models import organization as ghop_organization_model + + +class Logic(organization.Logic): + """Logic methods for the GHOPOrganization model. + """ + + def __init__(self, model=ghop_organization_model.GHOPOrganization, + base_model=soc.models.organization.Organization, + scope_logic=ghop_program_logic): + """Defines the name, key_name and model for this entity. + """ + + super(Logic, self).__init__(model, base_model=base_model, + scope_logic=scope_logic) + + +logic = Logic() diff -r 5992e2033ca2 -r bf70c5a0ef66 app/soc/modules/ghop/logic/models/program.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/modules/ghop/logic/models/program.py Sat Jun 06 17:28:56 2009 +0200 @@ -0,0 +1,47 @@ +#!/usr/bin/python2.5 +# +# Copyright 2009 the Melange authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""GHOPProgram (Model) query functions. +""" + +__authors__ = [ + '"Madhusudan.C.S" ' + ] + + +from soc.logic.models import program +from soc.logic.models import sponsor as sponsor_logic + +import soc.models.program + +from soc.modules.ghop.models import program as ghop_program_model + + +class Logic(program.Logic): + """Logic methods for the GHOPProgram model. + """ + + def __init__(self, model=ghop_program_model.GHOPProgram, + base_model=soc.models.program.Program, + scope_logic=sponsor_logic): + """Defines the name, key_name and model for this entity. + """ + + super(Logic, self).__init__(model, base_model=base_model, + scope_logic=scope_logic) + + +logic = Logic() diff -r 5992e2033ca2 -r bf70c5a0ef66 app/soc/modules/ghop/logic/models/task.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/modules/ghop/logic/models/task.py Sat Jun 06 17:28:56 2009 +0200 @@ -0,0 +1,47 @@ +#!/usr/bin/python2.5 +# +# Copyright 2009 the Melange authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""GHOPTask (Model) query functions. +""" + +__authors__ = [ + '"Madhusudan.C.S" ' + ] + + +from soc.logic.models import linkable + +import soc.models.linkable + +from soc.modules.ghop.logic.models import organization as ghop_org_logic +from soc.modules.ghop.models import task as ghop_task_model + + +class Logic(linkable.Logic): + """Logic methods for the GHOPTask model. + """ + + def __init__(self, model=ghop_task_model.GHOPTask, + base_model=soc.models.linkable.Linkable, + scope_logic=ghop_org_logic): + """Defines the name, key_name and model for this entity. + """ + + super(Logic, self).__init__(model, base_model=base_model, + scope_logic=scope_logic) + + +logic = Logic() diff -r 5992e2033ca2 -r bf70c5a0ef66 app/soc/modules/ghop/logic/models/timeline.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/modules/ghop/logic/models/timeline.py Sat Jun 06 17:28:56 2009 +0200 @@ -0,0 +1,47 @@ +#!/usr/bin/python2.5 +# +# Copyright 2009 the Melange authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""GHOPTimeline (Model) query functions. +""" + +__authors__ = [ + '"Madhusudan.C.S" ' + ] + + +from soc.logic.models import timeline +from soc.logic.models import sponsor as sponsor_logic + +import soc.models.timeline + +from soc.modules.ghop.models import timeline as ghop_timeline_model + + +class Logic(timeline.Logic): + """Logic methods for the GHOPTimeline model. + """ + + def __init__(self, model=ghop_timeline_model.GHOPTimeline, + base_model=soc.models.timeline.Timeline, + scope_logic=sponsor_logic): + """Defines the name, key_name and model for this entity. + """ + + super(Logic, self).__init__(model, base_model=base_model, + scope_logic=scope_logic) + + +logic = Logic() diff -r 5992e2033ca2 -r bf70c5a0ef66 app/soc/modules/ghop/logic/models/work_submission.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/modules/ghop/logic/models/work_submission.py Sat Jun 06 17:28:56 2009 +0200 @@ -0,0 +1,47 @@ +#!/usr/bin/python2.5 +# +# Copyright 2009 the Melange authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""GHOPWorkSubmission (Model) query functions. +""" + +__authors__ = [ + '"Madhusudan.C.S" ' + ] + +from soc.logic.models import linkable + +import soc.models.linkable + +from soc.modules.ghop.logic.models import organization as ghop_org_logic +from soc.modules.ghop.models import work_submission as \ + ghop_work_submission_model + + +class Logic(linkable.Logic): + """Logic methods for the GHOPWorkSubmission model. + """ + + def __init__(self, model=ghop_work_submission_model.GHOPWorkSubmission, + base_model=soc.models.linkable.Linkable, + scope_logic=ghop_org_logic): + """Defines the name, key_name and model for this entity. + """ + + super(Logic, self).__init__(model, base_model=base_model, + scope_logic=scope_logic) + + +logic = Logic()