This is not the document you are looking for? Use the search form below to find more!

Report home > Others

A brief history of Django model syntax

0.00 (0 votes)
Document Description
A brief history of Django model syntax
File Details
Submitter
  • Name: johanna
Embed Code:

Add New Comment




Related Documents

From Typing to Swiping: A Brief History of Interaction Design

by: hendrik, 74 pages

From Typing to Swiping: A Brief History of Interaction Design

Brief History of Branding

by: pauwel, 15 pages

Brief History of Branding

A Brief History of African Undersea Cables

by: tero, 18 pages

A Brief History of African Undersea Cables

A Brief History of the Dumpster

by: valentinhodg1016, 1 pages

How many dogs have chased a garbage truck down the street? And how long have they been chasing them? Garbage trucks and dumpsters have been around for quite a long time and have been a huge benefit ...

INFOGRAPHIC - a brief history of the free US iPad

by: billytrail, 1 pages

A free US iPad INFOGPRAHIC. Read about the history of the iPad in brief.

A Brief History of Television

by: rika, 13 pages

The history of pyschovisual studies probably began during ancient civilization. The architectural plans for the Greek Parthernon show that viewers could best take in the Parthenon if it ...

A Brief History of Fountains

by: rr224pah, 1 pages

A little knowledge about the history of fountains.

A BRIEF HISTORY OF LANDFILLS

by: shinta, 3 pages

Over the last decade, landfills have undergone many dramatic changes. The dug out pits, or what we called dumps, were left open for people to dispose of their throw away items. Today, ...

A Brief History Of The Crossbreed Florida R

by: fred26clausen, 2 pages

cars are very popular with regard to the current vehicle customers , high a wide range of reasons

A Brief History of Corn

by: rika, 1 pages

Since ancient times, corn has played an integral role in human history. Corn is a grass, native to the Americas. The exact origin of the grain remains unknown, but tiny ears of corn have been ...

Content Preview
A brief history of Django model syntaxr1000January 2004cms/apps/polls/dblayout.sqlBEGIN;CREATE TABLE polls ( id serial PRIMARY KEY, label varchar(20) NOT NULL, -- used by the template and possibly by the URL release_date timestamp with time zone NOT NULL, expire_date timestamp with time zone NOT NULL, question varchar(255) NOT NULL);CREATE INDEX polls_label ON polls (label);CREATE TABLE poll_choices ( id serial PRIMARY KEY, polls_id integer REFERENCES polls(id), choice varchar(255) NOT NULL, votes integer NOT NULL DEFAULT 0);CREATE TABLE poll_logged_votes ( poll_id integer NOT NULL REFERENCES polls(id), choice_id integer NOT NULL REFERENCES poll_choices(id), ip_address inet NOT NULL, vote_time timestamp with time zone NOT NULL, PRIMARY KEY (poll_id, ip_address, vote_time));CREATE TABLE polls_sites ( polls_id integer NOT NULL REFERENCES polls(id), sites_id integer NOT NULL REFERENCES sites(id), PRIMARY KEY (polls_id, sites_id));COMMIT;cms/apps/polls/polls.pyclass PollDoesNotExist(ObjectDoesNotExist): passclass ChoiceDoesNotExist(ObjectDoesNotExist): pass# ...class Poll: def __init__(self, id, label, release_date, expire_date, question): # ... def save(self): # ... def get_choices(self): # ...# ...def get_poll_by_id(poll_id): # ...def get_poll_by_label(label, year, month): # ...def get_poll_list(year=None, month=None): # ...r4000August 2004cms/datadescriptions/polls.pyclass Poll(gen.DataDescription): app_name = APP_NAME app_label = APP_LABEL module_name = 'polls' object_name = 'Poll' object_name_verbose = 'poll' db_table = 'polls' representation = ['return self.question'] fields = ( gen.AutoincrementField('id', 'ID', primary_key=True), gen.SlugField('slug', 'slug', unique_for_month='pub_date'), gen.CharacterField('question', 'question', maxlength=255), gen.DatetimeField('pub_date', 'date published', create_list_lookup_function=True, lookup=gen.DATEPART, create_next_previous=True), gen.DatetimeField('expire_date', 'expiration date'), gen.ManyToManyField('sites', 'sites', can_be_blank=True, relationship=gen.ManyToManyRelation(core.Site, 'site_id')), ) list_ordering_tuple = (('pub_date', gen.ORDER_ASCENDING),) exceptions = ( ('AlreadyVoted', None), ('PollClosed', None), ('InvalidVote', "An attempt to vote for a choice that isn't associated with the given poll") ) generate_admin = True hierarchical_admin = (gen.BY_DATE, 'pub_date') add_permission = ('add_poll', 'Can add polls') change_permission = ('change_poll', 'Can change polls') template_admin_form = 'polls_form' admin_url = 'polls' admin_field_conf = ( (None, {'classes': ('aligned',), 'fields': ('question', 'slug', 'pub_date', 'expire_date', 'sites')}), ) extra_model_code_top = "from settings import POLL_VOTE_INTERVAL"cms/apps/polls/polls.py# DO NOT EDIT THIS FILE MANUALLY. IT WAS GENERATED BY A PROGRAM.r8825June 2005First public Django releaseellington/polls/models/polls.pyclass Poll(meta.Model): db_table = 'polls' fields = ( meta.SlugField('slug', 'slug', unique_for_month='pub_date'), meta.CharField('question', 'question', maxlength=255), meta.DateTimeField('pub_date', 'date published'), meta.DateTimeField('expire_date', 'expiration date'), meta.ManyToManyField(core.Site), meta.PositiveSmallIntegerField('choice_votes', 'choice votes', default=1, help_text="How many choices a person can vote for at once."), ) ordering = ('-pub_date',) exceptions = ('AlreadyVoted', 'PollClosed', 'InvalidVote', 'TooFewChoices', 'TooManyChoices') get_latest_by = 'pub_date' admin = meta.Admin( fields = ( (None, {'fields': ('question', 'slug', 'pub_date', 'expire_date', 'sites', 'choice_votes')}), ), list_display = ('question', 'pub_date', 'expire_date'), list_filter = ('sites', 'pub_date'), date_hierarchy = 'pub_date', search_fields = ('question', 'slug'), )r9000Django 0.91

Download
A brief history of Django model syntax

 

 

Your download will begin in a moment.
If it doesn't, click here to try again.

Share A brief history of Django model syntax to:

Insert your wordpress URL:

example:

http://myblog.wordpress.com/
or
http://myblog.com/

Share A brief history of Django model syntax as:

From:

To:

Share A brief history of Django model syntax.

Enter two words as shown below. If you cannot read the words, click the refresh icon.

loading

Share A brief history of Django model syntax as:

Copy html code above and paste to your web page.

loading