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 sys | |
import re | |
from pprint import pprint | |
from operator import itemgetter | |
from xml.dom import minidom | |
DEBUG = len(sys.argv[1:]) | |
xml_filename = 'dump.xml' | |
ignore_titles = ['Main Page'] |
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
#!/usr/bin/env python3 | |
import random | |
from pprint import pformat | |
from collections import OrderedDict | |
import http.client | |
import json | |
import re | |
import discord |
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
{ | |
typenames: { | |
1: "Solos", | |
2: "Warlocks", | |
3: "Warbeasts", | |
4: "Units", | |
5: "Attachments", | |
6: "Warjacks", | |
7: "Warcasters", | |
8: "Battle Engines", |
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
Shut your big Yapper! | |
http://www.soundboard.com/handler/DownLoadTrack.ashx?cliptitle=Shut+your+big+Yapper!&filename=nz/Nzg1NTExMDQ3ODU2MTM_CszBS4NSZB4.mp3 | |
Whats your name 2 | |
http://www.soundboard.com/handler/DownLoadTrack.ashx?cliptitle=Whats+your+name+2&filename=mj/Mjg5NzQ5OTI4OTc5Nw_US_2b_2bIDyO564.mp3 | |
Hellooooo | |
http://www.soundboard.com/handler/DownLoadTrack.ashx?cliptitle=Hellooooo&filename=nt/NTYzOTMzMDc1NjM5NzY_CHlUlM20e8k.mp3 |
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
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from __future__ import print_function | |
# ripped from djangotoolbox | |
# duplicated here to avoid external dependency | |
def make_tls_property(default=None): |
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
Validating models... | |
[31/Dec/2014 21:34:48] DEBUG [raven.contrib.django.client.DjangoClient.__init__:148] Configuring Raven for host: http://dceeef2eb8204da58d2f947311c3a845:[email protected]:/7 | |
--------------------------------------------- | |
<django.db.models.fields.related.ForeignKey: history_user> <django.db.models.fields.related.ManyToOneRel object at 0x10e5b5690> id <class 'apps.core.user.User'> | |
--------------------------------------------- | |
<django.db.models.fields.related.ForeignKey: company> <django.db.models.fields.related.ManyToOneRel object at 0x10e5a7b50> id <class 'apps.company.models.Company'> | |
--------------------------------------------- | |
<django.db.models.fields.related.ForeignKey: home> <django.db.models.fields.related.ManyToOneRel object at 0x10e5a7d10> id <class 'apps.home.models.Home'> | |
--------------------------------------------- |
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
{ | |
"object_endpoint": "", | |
"object_name": unicode(new_instance), | |
"object": { | |
# Fresh api pull of the object | |
}, | |
"url": '/model/pk/', | |
} |
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
{ | |
"fields": [ | |
{ | |
"field_name": "name", // Simple field name | |
"prefixed_name": "name", // Potentially scoped, like "community-0-name" | |
"label": "Community Name", // verbose_name according to the form/model | |
"value": "Verrado", // "initial" for new forms, or else existing value | |
"value_label": null, // For ModelChoiceField foreignkeys, "value" is an id, so this is the unicode of that object. | |
"help_text": "A community, also known as a \"master-planned community\", is a parcel of land in which one or more builders intend to build several subdivisions. To add a community association or create a new community, type the first few letters of the name of the community that you wish to associate with. If the community you wish to associate with already exists within the database, select it from the \"Select from existing\" list and click on \"Submit\" at the bottom of this page to create the association. If the community does not exist |
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
{ | |
"actions": [ | |
{ | |
"name": "static", | |
"style": null, | |
"actions": [ | |
{ | |
"name": "", | |
"icon": "gears", | |
"instruction": null, |
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
class RelatedCompaniesField(serializers.WritableField): | |
def __init__(self, *args, **kwargs): | |
self.company_type = kwargs.pop('company_type') | |
super(RelatedCompaniesField, self).__init__(*args, **kwargs) | |
def to_native(self, obj): | |
relationships = obj.relationships.filter_by_company_type(self.company_type) | |
ids = list(relationships.get_orgs(self.company_type, ids_only=True)) | |
return ids |
NewerOlder