Package: djangodbu
DjangoDBUTools for debugging DjangoSummarydorm: Pretty print models, querysets, etc.ds: Search dictionaries and lists for string.ago: Generate datetimes.DORM - Debug Django ORMPretty print django objects with syntax highlighting, column layout and shorthands.Dorm can handle:model instancesattribute coloring + groupingattribute valuesprint in parallel columnsquerysetsprint all rows in querysetprints selected values (in values=[] fashion) or value from 'callable'paginate, with skipt to pagequerysyntax highlightlist / dict / tuple through pprintRequirementsPython 2DjangosqlparseInstallation$ pip install djangodbuUsageStart Django shell_plus:python manage.py shell_plus>>>fromdjangodbuimportdorm>>>dorm(MyModel.objects.get(id=123))instancemethod serializable_value
          instancemethod set_password
          instancemethod set_unusable_password
          instancemethod unique_error_message
          instancemethod validate_unique
                 unicode USERNAME_FIELD: username
                 unicode email: some.one@example.org
                 unicode first_name: Some
                 unicode last_name: One
                 unicode password: pbkdf2_sha256$20000$
                 unicode username: someone
                    list REQUIRED_FIELDS: 1
                    long id: 357
                    long pk: 357
 so.mo.na.AccountingUser accountinguser: 651 > 'Some One'
          RelatedManager additionalemail_set: 1
          RelatedManager callback_set: 0
          RelatedManager campaigncode_set: 0
          RelatedManager grouplog: 142
      ManyRelatedManager groups: 0
          RelatedManager log: 379
          RelatedManager logevent_set: 89
          RelatedManager message_set: 11
        lo.pa.to.Payment payment: 510 > 'Bob & Uncle'
          RelatedManager settings_set: 1
          RelatedManager social_auth: 0
      ManyRelatedManager user_permissions: 0
          RelatedManager worker_set: 1
                NoneType activationcode
                NoneType auth_token
                NoneType employee
                    bool is_active: True
                    bool is_superuser: False
       datetime.datetime date_joined: 2016-05-01 08:13:16+00:00
       datetime.datetime last_login: 2016-06-20 07:48:51+00:00
                    type DoesNotExist: DoesNotExist
                classobj Meta: Meta
                    type MultipleObjectsReturned: MultipleObjectsReturnedPrinting QuerySets:>>>dorm(MyModel.objects.all())1:userA2:userB4:userD20:userY...Selecting values for QuerySet:>>>dorm(User.objects.all(),v='first_name, email')id:firstnameemail------------------------------------------------1:abcduserA@example.org2:efghijuserB@example.org4:kluserD@example.org20:MnopqrstuserY@example.org...Print Query:>>>dorm(User.objects.filter(email__isnull=False).exclude(first_name='kl').query)SELECTauth_user.id,auth_user.password,auth_user.username,auth_user.first_name,auth_user.last_name,auth_user.emailFROMauth_userWHERE(auth_user.emailISNOTNULLANDNOT(auth_user.first_name=kl))DS - Dictionary search'ds' accepts dictionaries and lists.Usage>>>fromdjangodbuimportds>>>ds(haystack_dict,'needle')>>>fromdbu.utilsimportds>>>test={'a':['b','c'],'d':3,'e':{'f':'g'},'h':'i'}>>>ds(test,'a')a:['b','c']>>>ds(test,'b')a>0:'b'>>>ds(test,'c')a>1:'c'>>>ds(test,'d')d:3>>>ds(test,'e')e:{'f':'g'}>>>ds(test,'f')e>f:'g'>>>ds(test,'g')e>f:'g'>>>ds(test,'h')h:'i'>>>ds(test,'i')h:'i'Project urldjangodbu on githubdjangodbu on pypi