This file contains 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 python | |
import sys | |
import requests | |
def get_info(terrible_key, cluster, product=None): | |
if product: | |
url = 'https://terrible.sanomaservices.nl/env/list/{}/{}'.format(cluster, product) | |
else: |
This file contains 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
def used_in(self): | |
""" | |
Method to return all objects where this object is linked from by | |
a foreign key or many-to-many relationship | |
Be aware that: | |
- Calling this method wil result in as many queries as there are | |
relations, so use this carefully. | |
- It will only see the models linking directly to this model. So watch | |
out for inherited models. Calling used_in on a childobject will |