[copr] master: Add contribution guidelines that specify some basics about *Logic objects (1d90502)

bkabrda at fedoraproject.org bkabrda at fedoraproject.org
Wed Jan 23 15:16:45 UTC 2013


Repository : http://git.fedorahosted.org/cgit/copr.git

On branch  : master

>---------------------------------------------------------------

commit 1d9050244a31e7afea4de872c1bf361153fcd519
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Wed Jan 23 13:48:49 2013 +0100

    Add contribution guidelines that specify some basics about *Logic objects


>---------------------------------------------------------------

 coprs_frontend/CONTRIBUTION_GUIDELINES |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/coprs_frontend/CONTRIBUTION_GUIDELINES b/coprs_frontend/CONTRIBUTION_GUIDELINES
new file mode 100644
index 0000000..98f24e3
--- /dev/null
+++ b/coprs_frontend/CONTRIBUTION_GUIDELINES
@@ -0,0 +1,18 @@
+This file contains some "should" rules, that are good to follow.
+
+- coprs.logic
+-- The methods of *Logic objects should generally be @classmethod.
+-- The methods of *Logic objects should accept "user" as a second argument
+   (after the "cls" argument). This argument should contain object of user
+   who is performing the action.
+-- The methods of *Logic objects shouldn't call db.session.commit(). This
+   should be called in views that use the methods.
+-- The usual names of methods are (each of the methods can perform certain
+   checks, e.g. authorization, correct parameters, ...):
+--- "add" for creating objects and adding them to session
+--- "new" for just adding objects to session
+--- "get" for getting a query object for a single model object
+--- "get_multiple" for getting a query object for multiple model objects
+--- "edit" for editing objects and adding them to session
+--- "update" for just adding altered objects to session
+--- "delete" for deleting an object



More information about the copr-devel mailing list