| author | ymh <ymh.work@gmail.com> |
| Wed, 20 Jan 2010 00:34:04 +0100 | |
| changeset 0 | 0d40e90630ef |
| permissions | -rw-r--r-- |
| 0 | 1 |
from django.core.management.base import BaseCommand, CommandError |
2 |
||
3 |
class ArgsCommand(BaseCommand): |
|
4 |
""" |
|
5 |
Command class for commands that take multiple arguments. |
|
6 |
""" |
|
7 |
args = '<arg arg ...>' |
|
8 |
||
9 |
def handle(self, *args, **options): |
|
10 |
if not args: |
|
11 |
raise CommandError('Must provide the following arguments: %s' % self.args) |
|
12 |
return self.handle_args(*args, **options) |
|
13 |
||
14 |
def handle_args(self, *args, **options): |
|
15 |
raise NotImplementedError() |