Revision 5ed5f9e6

b/snf-astakos-app/astakos/im/management/commands/project-application-approve.py
41 41

  
42 42
class Command(BaseCommand):
43 43
    args = "<project application id>"
44
    help = "Approve project application"
44
    help = """
45
    Approve a pending project application
46

  
47
    You can discover projects with a pending application with
48
    (the last column <AppID> is the application to be approved):
49

  
50
        snf-manage project-list --pending
51

  
52
    You can examine a specific application with:
53

  
54
        snf-manage project-show --app <AppId>
55

  
56
    For a given project, you can examine a pending application with:
57

  
58
        snf-manage project-show <project> --pending
59
"""
45 60

  
46 61
    def handle(self, *args, **options):
47 62
        if len(args) < 1:
b/snf-astakos-app/astakos/im/management/commands/project-application-deny.py
42 42

  
43 43
class Command(BaseCommand):
44 44
    args = "<project application id>"
45
    help = "Deny a project application"
45
    help = """
46
    Deny a project application
47

  
48
    You can discover projects with a pending application with
49
    (the last column <AppID> is the application to be denied):
50

  
51
        snf-manage project-list --pending
52

  
53
    You can examine a specific application with:
54

  
55
        snf-manage project-show --app <AppId>
56

  
57
    For a given project, you can examine a pending application with:
58

  
59
        snf-manage project-show <project> --pending
60
"""
46 61

  
47 62
    @transaction.commit_on_success
48 63
    def handle(self, *args, **options):
b/snf-astakos-app/astakos/im/management/commands/project-list.py
40 40

  
41 41

  
42 42
class Command(NoArgsCommand):
43
    help = "List projects and project status"
43
    help = """
44
    List projects and project status.
45

  
46
    Project status can be one of:
47
      Pending              an application <AppId> for a new project
48

  
49
      Active               an active project
50

  
51
      Active - Pending     an active project with
52
                           a pending modification <AppId>
53

  
54
      Denied               an application for a new project,
55
                           denied by the admin
56

  
57
      Dismissed            a denied project, dismissed by the applicant
58

  
59
      Cancelled            an application for a new project,
60
                           cancelled by the applicant
61

  
62
      Suspended            a project suspended by the admin;
63
                           it can later be resumed
64

  
65
      Suspended - Pending  a suspended project with
66
                           a pending modification <AppId>
67

  
68
      Terminated           a terminated project; its name can be claimed
69
                           by a new project
70
"""
44 71

  
45 72
    option_list = NoArgsCommand.option_list + (
46 73
        make_option('-c',
......
58 85
                    dest='full',
59 86
                    default=False,
60 87
                    help="Do not shorten long names"),
88
        make_option('--pending',
89
                    action='store_true',
90
                    dest='pending',
91
                    default=False,
92
                    help="Show only projects with a pending application"),
61 93
    )
62 94

  
63 95
    def handle_noargs(self, **options):
......
74 106
        if options['skip']:
75 107
            chain_dict = do_skip(chain_dict)
76 108

  
109
        if options['pending']:
110
            chain_dict = pending_only(chain_dict)
111

  
77 112
        allow_shorten = not options['full']
78 113

  
79 114
        for info in chain_info(chain_dict):
......
103 138

  
104 139
            self.stdout.write(line + '\n')
105 140

  
141
def pending_only(chain_dict):
142
    d = {}
143
    for chain, (state, project, app) in chain_dict.iteritems():
144
        if state in Chain.PENDING_STATES:
145
            d[chain] = (state, project, app)
146
    return d
147

  
106 148
def do_skip(chain_dict):
107 149
    d = {}
108 150
    for chain, (state, project, app) in chain_dict.iteritems():
b/snf-astakos-app/astakos/im/management/commands/project-show.py
42 42

  
43 43
class Command(BaseCommand):
44 44
    args = "<id or name>"
45
    help = "Show project details"
45
    help = """
46
    Show project details.
47

  
48
    Command comes in two forms:
49
        project-show <id>    Look up project by id
50

  
51
        project-show <name>  Look up all projects whose name
52
                             contains the given string
53
"""
46 54

  
47 55
    option_list = BaseCommand.option_list + (
48 56
        make_option('--app',
49 57
                    action='store_true',
50 58
                    dest='app',
51 59
                    default=False,
52
                    help="Show application details instead"),
60
                    help="Show details of applications instead of projects"
61
                    ),
53 62
        make_option('--pending',
54 63
                    action='store_true',
55 64
                    dest='pending',
56 65
                    default=False,
57
                    help="Show pending modification too"),
58
    )
66
                    help=("For a given project, show also pending modifications "
67
                          "(applications), if any")
68
                    ),
69
        )
59 70

  
60 71
    def handle(self, *args, **options):
61 72
        if len(args) != 1:

Also available in: Unified diff