aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/sql/models.py
Commit message (Collapse)AuthorAgeFilesLines
* sql db design suggestions by Svavar KjarrvalElrond2012-02-111-3/+26
| | | | | | | | Many thanks go to Svavar Kjarrval who has taken a deeper look at our current sql db design and made a bunch of suggestions. The suggestions are currently put as TODO items in the docstrings. This way we can keep track of them directly where we need it.
* Fix copyright statements; add LICENSE for EXIF.pyWill Kahn-Greene2012-02-081-1/+1
|
* Some small SQL model improvementsElrond2012-01-291-2/+7
| | | | | | | | - Add default for User.email_verified - Add default for MediaEntry.state - Let PathTupleWithSlashes store [] as "NULL", but not handling the reverse properly yet! - Add _id alias field to MediaEntry and MediaComment
* Nearly complete support for TagsElrond2012-01-281-4/+36
| | | | | | | | | | | These changes allow all of the rest of the code to use tags in sql as they were used on mongo. It's not efficient at all, as changing tags usually means to remove all old tags and adding all new. The only problem here is: Old slugs for tags are not removed, because they're shared across all MediaTags and dropping orphans is not always easy.
* Let some code support "media without slug"Elrond2012-01-281-1/+1
| | | | | | | | | | | | | | The upcoming SQL database will allow having media without a slug again. This might especially be useful for API support, where the uploaded image (media) does not have *any* information to generate a slug from. This code change mostly allows the sql backend to have no slug in its model and improves some parts to properly handle that. It specifically does not have any web frontend support to edit/create MediaEntries with no slug.
* Move declarative_base Base into base.pyElrond2012-01-261-5/+1
| | | | The base class of all models "Base" should be in base.py.
* Proper url_to_{prev,next} for SQLElrond2012-01-221-0/+21
| | | | Uses complete sqlalchemy syntax now.
* Create a fully functional get_comments for SQLElrond2012-01-221-0/+7
| | | | | Using proper sqlalchemy syntax instead of the emulated mongo one.
* License "all rights reserved" default should be None/NULL, not empty stringChristopher Allan Webber2012-01-211-1/+1
|
* Added migration for license field, resolved conflict in db/sql/models.pyAaron Williamson2012-01-191-5/+22
|\
| * Add copyright header and a bit of pep8ificationElrond2012-01-201-8/+25
| | | | | | | | | | | | Nearly all the sql files missed a copyright header. So added it! And while there fixed a few pep8 things.
* | Moved get_license_data to mixin.py, added license to sql media model, added ↵Aaron Williamson2012-01-181-0/+1
|/ | | | translation tags to license template.
* Add MediaFile table and related infrastructure.Elrond2012-01-111-2/+25
| | | | | | | | | | | | - This adds a new SQL table field type for path tuples. They're stored as '/' separated unicode strings. - Uses it to implement a MediaFile table. - Add relationship and proxy fields on MediaEntry to give a nice media_files "view" there. - Let the converter fill the MediaFile.
* Add DB Mixin classes and use themElrond2012-01-081-2/+3
| | | | | | | | | | | | | | | A bunch of functions on the db objects are really more like "utility functions": They could live outside the classes and be called "by hand" passing the appropiate reference. They usually only use the public API of the object and rarely use database related stuff. Goals: - First, simple: Share the code with the SQL objects, so that the code doesn't need to be duplicated. - Second, it might unclutter the db models and make them more into "model only" stuff. - Doesn't really hurt.
* SQL Model: Add relationship propertiesElrond2011-12-281-0/+5
| | | | | | MediaEntry now has a get_uploader (property) loading the appropiate User object for the MediaEntry (and caches it). MediaComment has the same for author as get_author.
* SQL Model: Forgot MediaEntry.state fieldElrond2011-12-281-0/+1
| | | | | | | | While creating the new SQL model, the "state" field of MediaEntry was left out. Currently using a plain unicode string for it. Maybe should use sqlalchemy.types.Enum?
* Implement _id proxy on sql objects (on User for now)Elrond2011-12-281-0/+14
| | | | | | | | So that the old code can access the primary key still as "._id". Quite simple Python Descriptor thing. Very generic.
* SQL: mongokit like interfaceElrond2011-12-181-1/+3
| | | | | | | | In trying to ease the migration to SQL, created an interface to sqlalchemy that looks a lot like the interface that is currently in use. *WARNING* Work in progress
* Little sql model updateElrond2011-12-171-1/+2
| | | | | | - Add title to the MediaEntry - Rename fp_verification_expire to fp_token_expire to follow the mongo model.
* SQL: Some toys and little fixElrond2011-12-151-1/+12
| | | | | | | | Run bin/python mediagoblin/db/sql/models.py and watch the create tables on a memory sqlite db. Also unicode strings need unicode defauls. Warning by sqlalchemy.
* Move sql models into db/sql/Elrond2011-12-151-0/+95
So we can play with the sql models, let's put them in a proper place.