This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Mapping annotated dict list into Django models

Usage

Wrap your django queryset or list with django-d2m functions

from django_d2m import queryset_to_model

queryset = CashUsageLog.objects.values('product__episode__comic').annotate(cash_used=Sum('cash'))
i_want_real_objects = queryset_to_model(queryset)

# You can convert just a dict
from django_d2m import dict_to_model
dict_to_model(some_dict_contains_only_id, MyModel)

# Or, for list
from django_d2m import list_to_model
list_to_model(some_dict_list, YourModel)

Before

{'product__episode__comic': 10L, 'cash_used': 3100}
{'product__episode__comic': 7L, 'cash_used': 1100}
{'product__episode__comic': 15L, 'cash_used': 800}

After

{'product__episode__comic': <Comic: 다즐짱>, 'cash_used': 3100}
{'product__episode__comic': <Comic: 파이일기>, 'cash_used': 1100}
{'product__episode__comic': <Comic: 스카리의 유희>, 'cash_used': 800}

Install

pip install django-d2m

License

MIT

Author

@lqez

Release History

Release History

0.1.4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-d2m-0.1.4.tar.gz (4.0 kB) Copy SHA256 Checksum SHA256 Source Apr 30, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting