Code Monkey home page Code Monkey logo

atom-django's Introduction

Django for Atom

Build Django apps faster with Atom.

Install

$ apm install atom-django

Or Settings ➔ Install ➔ Search for atom-django

Features

Snippets

This plugin features several snippets to help you write boilerplate code faster, mostly for writing out models' Fields. These snippets also have preset insertion points that let you tab between various parts of the snippet that you likely want to change. These are noted in the snippets below as $1, $2, and so on. Occasionally these have default values inside them such as ${1:default value}.

Basic model skeleton

model becomes:

class ${1:Modelname}(models.Model):
    """${2:($1 description)}"""
    $0
    def __unicode__(self):
        return u"$1"

AutoField

auto becomes:

${1:FIELDNAME} = models.AutoField()

BooleanField

boolean becomes:

${1:FIELDNAME} = models.BooleanField(${2:default=True})

CharField

char becomes:

${1:FIELDNAME} = models.CharField(${2:blank=True}, max_length=${3:100})

CommaSeparatedIntegerField

commaseparatedinteger becomes:

${1:FIELDNAME} = models.CommaSeparatedIntegerField(max_length=$2)

DateField

date becomes:

${1:FIELDNAME} = models.DateField(${2:default=datetime.datetime.today})

DateTimeField

datetime becomes:

${1:FIELDNAME} = models.DateTimeField(${2:blank=True}${3:, default=datetime.datetime.now})

DecimalField

decimal becomes:

${1:FIELDNAME} = models.DecimalField(max_digits=$2, decimal_places=$3)

EmailField

email becomes:

${1:FIELDNAME} = models.EmailField()

FileField

file becomes:

${1:FIELDNAME} = models.FileField(upload_to=${1:/path/for/upload})

FilePathField

filepath becomes:

${1:FIELDNAME} = models.FilePathField(path="${1:/location/of/choices}"${2:, match="${3:regex}"}${4:, recursive=True})

FloatField

float becomes:

${1:FIELDNAME} = models.FloatField()

ForeignKey

fk becomes:

${1:FIELDNAME} = models.ForeignKey(${2:RELATED_MODEL})

IPAddressField

ipaddress becomes:

${1:FIELDNAME} = models.IPAddressField(${2:blank=True})

ImageField

image becomes:

${1:FIELDNAME} = models.ImageField(upload_to="${2:/dir/path}"${3:, height_field=$4}${5:, width_field=$6})

IntegerField

integer becomes:

${1:FIELDNAME} = models.IntegerField(${2:blank=True, null=True})

ManyToManyField

manytomany becomes:

${1:FIELDNAME} = models.ManyToManyField(${2:RELATED_MODEL})

NullBooleanField

nullboolean becomes:

${1:FIELDNAME} = models.NullBooleanField(${2:default=True})

PhoneNumberField

phonenumber becomes:

${1:FIELDNAME} = models.PhoneNumberField(${2:blank=True})

PositiveIntegerField

positiveinteger becomes:

${1:FIELDNAME} = models.PositiveIntegerField(${2:blank=True, null=True})

PositiveSmallIntegerField

positivesmallinteger becomes:

${1:FIELDNAME} = models.PositiveSmallIntegerField(${2:blank=True, null=True})

SlugField

slug becomes:

${1:slug} = models.SlugField()

SmallIntegerField

smallinteger becomes:

${1:FIELDNAME} = models.SmallIntegerField(${2:blank=True, null=True})

TextField

text becomes:

${1:FIELDNAME} = models.TextField(${2:blank=True})

TimeField

time becomes:

${1:FIELDNAME} = models.TimeField(${2:blank=True})

URLField

url becomes:

${1:FIELDNAME} = models.URLField(${2:blank=True})

USStateField

usstate becomes:

${1:FIELDNAME} = models.USStateField(${2:blank=True})

XMLField

xml becomes:

${1:FIELDNAME} = models.XMLField(schema_path=${2:/path/to/RelaxNG}${3:, blank=True})

send_mail

sendmail becomes:

mail.send_mail("${1:Subject}", "${2:Message}", "${3:[email protected]}", ${4:["[email protected]"]}${5:, fail_silently=True})

Release Notes

0.3.1

0.1.0

  • Initial build of Django for Atom.
  • At the moment it is merely a clone of the superb Django TextMate bundle but new content may be added in the future.

License

MIT © Zachary Jones

atom-django's People

Contributors

bhhaskin avatar flimm avatar taylon avatar zacharytamas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.