python - Custom Django-admin command issue -


In an attempt to understand how a custom admin command works, I have my project called "mailing" and the name " Msystem ". I have written it in retrieve.py mailing / msystem / management / commands / folder and I have pasted an empty init .py and both management and cpmmands folders. Import alarm command from BaseCommand mail.msystem.models from the Django.core.management.base Import

Commands: Base = "data shows" DRF handle (self, * args, ** Option): X = Alarm.Obages I have all the () for x: print I.name

I'm trying to "pause management / retrieve" when I get the "indention" error strange, but this I feel good for me, can you suggest me what I have to do or what is the problem me

thanks

Your indentation should be consistent through the entire file, which is not in the snippet you posted above. Yes

"help =" line is applied after four "squares", but then the "x =" line has been indented more than four.

Perhaps you are mixing spaces and tabs and thus there are two tabs before "x ="?

Your code should look like this: Import the alarm class command from BaseCommand mailing.msystem.models to django.core Management.base Import from

 : Base = " The data displays "def handle (self, * argets, ** option): x = Alarm.objects.all () in I for X: print I.name  
< / Html>

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -