Hello, trying to understand how custom admin commands work, I have my project named "mailing" and app inside named "msystem", I have written this retrieve.py to the mailing/msystem/management/commands/ folder and I have pasted an empty init.py both to the management and cpmmands folders.
from django.core.management.base import BaseCommand
from mailing.msystem.models import Alarm
class Command(BaseCommand):
help = "Displays data"
def handle(self, *args, **options):
x = Alarm.objects.all()
for i in x:
print i.name
I am weirdly getting "indention" error for handle function when I try "python manage.py retrieve" however it looks fine to me, can you suggest me what to do or point me the problem
Thanks