2018-02-26 17:20:59 +01:00
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
from profiles import models as profiles
|
|
|
|
from histories.models import generate_history
|
|
|
|
from datetime import datetime
|
|
|
|
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
''' Generates an history and prints the related XML '''
|
|
|
|
|
|
|
|
def add_arguments(self, parser):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def handle(self, *args, **kwargs):
|
|
|
|
prof = profiles.Profile.objects.all()[0]
|
|
|
|
history = generate_history(prof, datetime.now())
|
2018-02-26 17:24:22 +01:00
|
|
|
print(history.to_xml_string())
|