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
author:Martín Gaitán <gaitan@gmail.com>
homepage:https://github.com/mgaitan/django-orm-magic
documentation:see this notebook

Define your django models in an IPython cell and use them on the fly. Let the magic do the boring part.

Django ORM isn’t conceived to be used standalone. Even for a trivial case, you need to configure a database, create an app, etc. This magic handle that automatically, and then import every model to your interactive session.

Install

You can install or upgrade via pip

pip install -U django-orm-magic

or directly from the repository using the %install_ext magic command:

In[1]: %install_ext https://raw.github.com/mgaitan/django-orm-magic/master/django_orm_magic.py

Basic usage

Once it’s installed, you can load it with %load_ext django_orm_magic. Then define your models in a cell started with the cell magic %%django_orm. For example:

In[2]: %load_ext django_orm_magic


In[3]: %%django_orm

       from django.db import models

       class Poll(models.Model):
           question = models.CharField(max_length=200)
           pub_date = models.DateTimeField('date published')

       class Choice(models.Model):
           poll = models.ForeignKey(Poll)
           choice_text = models.CharField(max_length=200)
           votes = models.IntegerField(default=0)

And it’s done. Every model is synced in a sqlite database named db.sqlite in your current path and imported automatically:

In[4]: Poll.objects.all()
Out[4]: []

In[5]: from django.utils import timezone
       p = Poll(question="What's new?", pub_date=timezone.now())
       p.save()

See the documentation for further details.

See here for another example

Changelog

0.3.1 / 2014-01-21

  • Fix bug #4 (now install via pip works)

0.3 / 2013-12-14

  • Added %django_settings magic
  • Added a tutorial notebook

0.2 / 2013-12-11

  • Moved the code to github.
  • Packaged and registered in PyPi

0.1 / 2013-10-29

  • First public release (as a gist)
Release History

Release History

0.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.3.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.3

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.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

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-orm-magic-0.4.tar.gz (3.8 kB) Copy SHA256 Checksum SHA256 Source Jun 26, 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