This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from xml.etree.ElementTree import fromstring | |
| from xmljson import parker | |
| xml_data = | |
| <?xml version="1.0"?> | |
| <COMMAND> | |
| <ID>2341</ID> | |
| <NAME>"testname"</NAME> | |
| <EMAIL>"testemail@gmail.com"</EMAIL> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| from django.utils import timezone | |
| now_time = timezone.now().timetuple() | |
| formatted_time = time.strftime("%d-%m-%Y %H:%M:%S", now_time) | |
| print(formatted_time) # it will print '15-12-2019 10:49:54' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.db import models | |
| from django.contrib.postgres.indexes import BrinIndex | |
| class Account(models.Model): | |
| id = models.AutoField() | |
| username = models.CharField(max_lenght=100) | |
| password = models.CharField(max_lenght=200) | |
| class Meta: |
NewerOlder