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
| #Some utilities to work with django models and foreign keys. | |
| #Especially useful for finding (and writing out) code to illuminate information about relations. | |
| # | |
| #To try it out, run show_relation_accessors(model) in a python prompt, or to be more general, get_related_instance_ids_code(model) | |
| # | |
| #-2011 CBWhiz | |
| # | |
| # | |
| #Usage sample: | |
| # from django.db import transaction |
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
| # Colorizes the output of the standard library logger, depending on the logger level: | |
| # To adjust the colors, look at Logger::Colors::SCHEMA and Logger::Colors::constants | |
| require 'logger' | |
| class Logger | |
| module Colors | |
| VERSION = '1.0.0' | |
| NOTHING = '0;0' |
NewerOlder