aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db
Commit message (Collapse)AuthorAgeFilesLines
...
| * Fix url_for_self mixupElrond2012-01-112-24/+5
| | | | | | | | | | Move changes from mongo/models:url_for_self back into mixin:url_for_self.
| * Merge branch 'master' of gitorious.org:mediagoblin/mediagoblinChristopher Allan Webber2012-01-103-42/+97
| |\ | | | | | | | | | | | | Conflicts: mediagoblin/db/mongo/models.py
| | * Add DB Mixin classes and use themElrond2012-01-083-61/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Fixed #724 and added extra infos to the atom feed (author uri and links to ↵Michele Azzolari2012-01-101-3/+5
| |/ | | | | | | the html version of each entry)
| * Import MigrationManager from mongo in mongo backend.Elrond2012-01-042-2/+2
| | | | | | | | | | | | Inside the mongo db backend, use the mongo MigrationManager. This is hopefully the last reference to the generic MigrationManager reference on db.util.
| * sql convert: Use more library functionsElrond2012-01-011-11/+9
| | | | | | | | | | | | | | | | | | | | 1. Use the new setup_connection_and_db_from_config in the sql backend. 2. Use sql and mongo specific functions wherever appropiate instead of the generic "db.X" one. This makes the converter more indepedent of the current backend choice.
| * Factor out check_db_migrations_currentElrond2012-01-013-1/+29
| | | | | | | | | | | | | | | | | | | | When initializing the database connection the current mongo based setup checked for new migrations and warned about them. This was mongo specific so factor'd it out into a more generic check_db_migrations_current function in the mongo backend. Also created a dummy one in the sql backend.
| * Add a .save method on the sql db objectsElrond2011-12-291-1/+9
| | | | | | | | | | | | | | | | This is a shortcut to adding the object to a session (if needed) and giving a commit on the session. In reality, calling code should probably utilize the session on its own and call commit in an appropiate place.
| * Support .get(fieldname) on sql db objectsElrond2011-12-291-0/+3
| | | | | | | | | | | | Some parts of the code like to call .get("somefield") on the db objects. It's easy to support this on sqlalchemy based objects, so lets do it.
| * 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-282-1/+2
| | | | | | | | | | | | | | | | 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.
| * Turn media.get_uploader into a propertyElrond2011-12-271-1/+2
| | | | | | | | | | | | | | sqlalchemy gives autoloading (hopefully caching) link to other objects as properties. So turn get_uploader on the current mongo based stuff into a property to ease transition.
| * Use media.url_for_self instead of calling urlgen directlyElrond2011-12-271-8/+4
| | | | | | | | | | | | | | | | | | Replace urlgen('ID', user=media.get_uploader().username, media=media.*) by media.url_for_self(urlgen) in a few places. It's just a lot nicer!
| * Move verification key generation to viewElrond2011-12-271-2/+0
| | | | | | | | | | | | | | | | Instead of creating the email verication key on the db model as a default for the field, create it in the registration view. Now all verification key generation is only in auth/views.py!
| * Improve .one() by using sqlalchemy's .one()Elrond2011-12-241-3/+1
| |
| * Add search level one() methodElrond2011-12-241-0/+13
| | | | | | | | And create a _fix_query_dict which converts '_id' to 'id'.
| * Turn MediaComment's author() into get_author propertyElrond2011-12-231-1/+2
| | | | | | | | | | | | | | | | | | 1) MediaComment's author method conflicts with the author field. So rename it to get_author. 2) Turn it from a normal function into a python property. That means you call it by ".get_author" not by ".get_author()". This is exactly what sqlalchemy gives us free of charge.
| * Move db/models.py -> db/mongo/models.pyElrond2011-12-202-1/+1
| | | | | | | | | | To my surprise, there was only ONE reference to models.py. From open.py.
| * Move db/migrations.py -> db/mongo/migrations.pyElrond2011-12-202-1/+1
| | | | | | | | And change references.
| * Move db/util.py -> db/mongo/util.pyElrond2011-12-204-278/+296
| | | | | | | | | | - Change some reference - Provide a wrapper db/util.py
| * Move db/indexes.py to db/mongo/indexes.pyElrond2011-12-202-1/+1
| | | | | | | | And change references (one!).
| * Move db/open.py to db/mongo/open.pyElrond2011-12-203-39/+71
| | | | | | | | | | | | | | | | | | | | | | | | Starting to move the mongo specific stuff into db/mongo. And create thin "from db.mongo.Y import z" wrappers in db/Y.py. Why? 1) Will make it lots easier to switch to sql for testing/developing. 2) The mongo stuff needs to stay around after moving to sql, because the converter needs it.
| * SQL: mongokit like interfaceElrond2011-12-184-2/+54
| | | | | | | | | | | | | | | | 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
| * Simple Mongo -> SQL migration toolElrond2011-12-171-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is just a start at a Migration tool from Mongo to SQL. It fills all currently available SQL models with data from MongoDB. A few fields in the SQL tables are left out, because some data format migrations are needed (notably: queue_file_name). This thing lives in mediagoblin/db/sql/convert.py because it has a lot of stuff hardcoded and is not, repeat not for end users! Hard coded: - output database: ./mediagoblin.db (sqlite) - Mediagoblin config: ./mediagoblin.ini
| * 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-152-0/+15
| | | | | | | | | | So we can play with the sql models, let's put them in a proper place.
| * Merge remote branch 'remotes/cwebber/sqlalchemy'Elrond2011-12-151-0/+95
| |\ | | | | | | | | | | | | * remotes/cwebber/sqlalchemy: Beginnings of sqlalchemy models
| | * Beginnings of sqlalchemy modelsChristopher Allan Webber2011-11-171-0/+95
| | |
| * | Dot-Notation for MediaEntry.media_dataElrond2011-12-051-2/+2
| | |
| * | Dot-Notation for MediaEntry.slugElrond2011-12-051-6/+6
| | |
| * | Dot-Notation for MediaEntry.titleElrond2011-12-051-1/+1
| | |
| * | Dot-Notation for MediaEntry.uploaderElrond2011-12-051-3/+3
| | |
| * | Dot-Notation for Users.pw_hashElrond2011-12-051-1/+1
| | |
| * | Dot-Notation for Users.usernameElrond2011-12-051-4/+4
| | |
| * | Merge remote-tracking branch 'remotes/jwandborg/master'Christopher Allan Webber2011-11-241-0/+8
| |\ \
| | * \ Merge branch 'video_gstreamer-only'Joar Wandborg2011-11-211-0/+8
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mediagoblin/db/migrations.py mediagoblin/submit/views.py
| | | * | Multimedia support - Commiting from a not yet finished state - Details belowJoar Wandborg2011-09-231-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * DONE Initially testing with arista ** DONE Video display templates *** TODO Multi-browser support ** TODO Video thumbnails ** TODO Link to original video ** TODO Video cropping Also contains a lot of "debug" print's
| * | | | Rename MediaEntry.uploader() to .get_uploader()Elrond2011-11-221-4/+4
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .uploader() method conflicts with the uploader database field. As we're moving to .FIELD for db field access, this is a relevant conflict. So renaming .uploader() to .get_uploader()
| * | | Added parameter ascending to MediaEntry::get_comments, if true, commentsPablo J. Urbano Santos2011-11-191-2/+7
| | | | | | | | | | | | | | | | will be ordered ascending, otherwise descending
| * | | Dot-Notation for "_id"Elrond2011-11-151-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: Migrations can't use "Dot Notation"! Migrations run on pymongo, not mongokit. So they can't use the "Dot Notation". This isn't really a big issue, as migrations are anyway quite mongo specific.
| * | | Enable mongokit's "Dot notation"Elrond2011-11-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mongokit documents can allow to use x.FIELD instead of x["FIELD"]. First it looks a lot more pythonic. Second it might allow us an easier migration path towards an sqlalchemy database backend. Docs: http://namlook.github.com/mongokit/tutorial.html#dot-notation
| * | | Merge remote-tracking branch 'remotes/nyergler/pep8-ification'Christopher Allan Webber2011-11-135-24/+27
| |\ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | Conflicts: mediagoblin/db/migrations.py mediagoblin/db/models.py mediagoblin/user_pages/views.py mediagoblin/util.py
| | * | has_key is deprecated, converting uses to use "in" operator.Nathan Yergler2011-10-011-1/+1
| | | |
| | * | Whitespace and formatting cleanup.Nathan Yergler2011-10-016-24/+27
| | |/ | | | | | | | | | | | | | | | | | | * Removed trailing whitespace * Line length < 80 where possible * Honor conventions on number of blank lines * Honor conventions about spaces around :, =
* | / First crack at basic license support.Aaron Williamson2012-01-171-0/+9
|/ /
* | Factor out a add_table_field functionElrond2011-10-211-23/+16
| | | | | | | | | | | | Migrations often just add a new field to some table/collection. So just have a nice helper function for this!
* | Finished splitting util.py into separate files.Aaron Williamson2011-10-012-8/+6
| |
* | Moved common, translation, template, and url code out of util.py and into ↵Aaron Williamson2011-10-011-2/+2
|/ | | | tools/[file].py