Changeset 24

Show
Ignore:
Timestamp:
02/03/07 15:35:39 (6 years ago)
Author:
joshua
Message:

* created and added a pudge template (including css and two images)
* added a couple of (mostly empty) rst-files under /doc
* updated some docstrings, so that the generated html-files look prettier
* added setup.cfg and updated setup.py for pudge-integration
* copied docstring from init.py as long_description to setup.py

Location:
elixir/trunk
Files:
16 added
8 modified

Legend:

Unmodified
Added
Removed
  • elixir/trunk/elixir/__init__.py

    r23 r24  
    11''' 
    2 Elixir 
     2Elixir package 
    33     
    44A declarative layer on top of SQLAlchemy, which is intended to replace the 
     
    1212not need the full expressiveness of SQLAlchemy's manual mapper definitions. 
    1313 
    14 For an example of how to use Elixir, please refer to the examples directory and 
    15 the unit tests.  The examples directory includes a TurboGears application with 
    16 full identity support called 'videostore'. 
     14For an example of how to use Elixir, please refer to the examples directory 
     15and the unit tests. The examples directory includes a TurboGears application 
     16with full identity support called 'videostore'. 
    1717''' 
    1818 
     
    5252 
    5353def create_all(): 
    54     """Create all necessary tables for all declared entities""" 
     54    'Create all necessary tables for all declared entities' 
    5555    for md in metadatas: 
    5656        md.create_all() 
    5757 
    5858def drop_all(): 
    59     """Drop all tables for all declared entities""" 
     59    'Drop all tables for all declared entities' 
    6060    for md in metadatas: 
    6161        md.drop_all() 
  • elixir/trunk/elixir/entity.py

    r22 r24  
    1919class Entity(object): 
    2020    ''' 
    21     The base class for all entities.  All Elixir model objects should inherit 
    22     from this class.  Statements can appear within the body of the definition  
    23     of an entity to define its fields, relationships, and other options.  Here 
    24     is an example: 
     21    The base class for all entities 
     22     
     23    All Elixir model objects should inherit from this class. Statements can 
     24    appear within the body of the definition of an entity to define its 
     25    fields, relationships, and other options. 
     26     
     27    Here is an example: 
     28 
     29    :: 
    2530     
    2631        class Person(Entity): 
     
    2833            has_field('birthdate', DateTime, default=datetime.now) 
    2934     
    30     For further information, please refer to the provided examples or tutorial. 
     35    For further information, please refer to the provided examples or 
     36    tutorial. 
    3137    ''' 
    3238     
  • elixir/trunk/elixir/examples/__init__.py

    r1 r24  
     1''' 
     2======== 
     3Examples 
     4======== 
     5 
     6Contains various example projects. 
     7''' 
  • elixir/trunk/elixir/fields.py

    r18 r24  
    1111class Field(object): 
    1212    ''' 
    13     Represents the definition of a 'field' on an entity.  In other words, this 
    14     class represents a column on the table where the entity is stored.  This  
    15     object is only used with the 'with_fields' syntax for defining all fields 
    16     for an entity at the same time.  The 'has_field' syntax does not require  
    17     the manual creation of this object. 
     13    Represents the definition of a 'field' on an entity. 
     14     
     15    This class represents a column on the table where the entity is stored. 
     16    This object is only used with the ``with_fields`` syntax for defining all 
     17    fields for an entity at the same time. The ``has_field`` syntax does not 
     18    require the manual creation of this object. 
    1819    ''' 
    1920     
     
    4243class HasField(object): 
    4344    ''' 
    44     Statement object for specifying a single field on an entity.  The first 
    45     argument is the name of the field, the second is its type, and following 
    46     this any number of keyword arguments can be specified for additional  
    47     behavior.  The keyword arguments are passed on to the SQLAlchemy 'Column' 
    48     object.  Please refer to the SQLAlchemy 'Column' object's documentation for 
    49     further detail about which keyword arguments are supported. 
     45    Statement object for specifying a single field on an entity. 
    5046     
    51     Here is a quick example of how to use 'has_field'. 
     47    The first argument is the name of the field, the second is its type, and 
     48    following this any number of keyword arguments can be specified for 
     49    additional behavior. The keyword arguments are passed on to the SQLAlchemy 
     50    ``Column`` object. Please refer to the SQLAlchemy ``Column`` object's 
     51    documentation for further detail about which keyword arguments are 
     52    supported. 
     53     
     54    Here is a quick example of how to use ``has_field``. 
     55     
     56    :: 
    5257     
    5358        class Person(Entity): 
     
    6469class WithFields(object): 
    6570    ''' 
    66     Statement object for specifying all fields on an entity at once.  Each  
    67     keyword argument to this statement represents one field, which should be 
    68     a Field object.  The first argument to a Field object is its type, and  
    69     following this any number of keyword arguments can be specified for  
    70     additional behavior.  The keyword arguments are passed on to the SQLAlchemy 
    71     'Column' object.  Please refer to the SQLAlchemy 'Column' object's  
    72     documentation for further detail about which keyword arguments are  
     71    Statement object for specifying all fields on an entity at once. 
     72     
     73    Each keyword argument to this statement represents one field, which should 
     74    be a Field object. The first argument to a Field object is its type, and 
     75    following this any number of keyword arguments can be specified for 
     76    additional behavior. The keyword arguments are passed on to the SQLAlchemy 
     77    ``Column`` object. Please refer to the SQLAlchemy ``Column`` object's 
     78    documentation for further detail about which keyword arguments are 
    7379    supported. 
    7480     
    75     Here is a quick example of how to use 'with_fields'. 
     81    Here is a quick example of how to use ``with_fields``. 
     82     
     83    :: 
    7684     
    7785        class Person(Entity): 
  • elixir/trunk/elixir/options.py

    r23 r24  
    1414    more.  To specify an option, simply supply the option as a keyword  
    1515    argument onto the statement, as follows: 
     16     
     17    :: 
    1618     
    1719        class Person(Entity): 
  • elixir/trunk/elixir/relationships.py

    r22 r24  
    11''' 
     2============= 
     3Relationships 
     4============= 
     5 
    26This module provides support for defining relationships between your Elixir  
    37entities.  The supported relationship types are as follows: 
    48 
    5     `belongs_to` 
    6     ------------ 
    7     Describes the child's side of a parent-child relationship.  For example,  
    8     a `Pet` object may belong to its owner, who is a `Person.`  This could be 
    9     expressed like so: 
    10                  
    11         class Pet(Entity): 
    12             belongs_to('owner', of_kind='Person', inverse='pets') 
    13      
    14     You must specify the 'kind' of object that you are relating to using the 
    15     of_kind keyword argument.  Additionally, if you plan on defining the other 
    16     side of the relationship, you should specify the name of the relationship 
    17     on the other side using the 'inverse' keyword argument. 
    18  
    19  
    20     `has_one` 
    21     --------- 
    22     TODO. 
    23      
    24  
    25     `has_many` 
    26     ---------- 
    27     TODO. 
    28  
    29  
    30     `has_and_belongs_to_many` 
    31     ------------------------- 
    32     TODO. 
     9`belongs_to` 
     10------------ 
     11Describes the child's side of a parent-child relationship.  For example,  
     12a `Pet` object may belong to its owner, who is a `Person.`  This could be 
     13expressed like so: 
     14             
     15    class Pet(Entity): 
     16        belongs_to('owner', of_kind='Person', inverse='pets') 
     17 
     18You must specify the 'kind' of object that you are relating to using the 
     19of_kind keyword argument.  Additionally, if you plan on defining the other 
     20side of the relationship, you should specify the name of the relationship 
     21on the other side using the 'inverse' keyword argument. 
     22 
     23 
     24`has_one` 
     25--------- 
     26TODO. 
     27 
     28 
     29`has_many` 
     30---------- 
     31TODO. 
     32 
     33 
     34`has_and_belongs_to_many` 
     35------------------------- 
     36TODO. 
    3337''' 
    3438 
  • elixir/trunk/elixir/statements.py

    r17 r24  
    11class Statement(object):     
    22    ''' 
    3     A 'statement' object represents a DSL term. 
     3    DSL-style syntax 
     4     
     5    A ``Statement`` object represents a DSL term. 
    46    ''' 
    57     
  • elixir/trunk/setup.py

    r17 r24  
     1from setuptools import setup, find_packages 
     2 
    13classifiers = """ 
    24    "Development Status :: 3 - Alpha", 
     
    911""" 
    1012 
    11 from setuptools import setup, find_packages 
    12  
    1313setup(name="Elixir", 
    1414      version="0.0.1", 
    1515      description="Declarative Mapper for SQLAlchemy", 
     16      long_description=""" 
     17Elixir 
     18====== 
     19 
     20A declarative layer on top of SQLAlchemy, which is intended to replace the 
     21ActiveMapper SQLAlchemy extension, and the TurboEntity project.  Elixir is a 
     22fairly thin wrapper around SQLAlchemy, which provides the ability to define  
     23model objects following the Active Record design pattern, and using a DSL  
     24syntax similar to that of the Ruby on Rails ActiveRecord system. 
     25 
     26Elixir does not intend to replace SQLAlchemy's core features, but instead  
     27focuses on providing a simpler syntax for defining model objects when you do 
     28not need the full expressiveness of SQLAlchemy's manual mapper definitions. 
     29""", 
    1630      author="", 
    1731      author_email="", 
     
    2337                'elixir.tests'], 
    2438      classifiers=classifiers, 
     39      extras_require = { 
     40        'pudge': ["docutils>=0.4", "elementtree>=1.2.6", "kid>=0.9",  
     41                  "Pygments==dev,>=0.7dev-r2661", "pudge==dev,>=0.1.3dev-r134",  
     42                  "buildutils==dev,>=0.1.2dev-r109",], 
     43      }, 
    2544      test_suite = 'nose.collector')