aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/models.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Use better relationships to delete collections.Elrond2013-01-231-5/+8
| | | | | | When deleting a User, his/her collections can be deleted by sqlalchemy: Collections do not need any special code to be executed on deletion.
* Add a license preference fieldMark Holmquist2013-01-171-0/+1
| | | | | | | | | | | | | This feature is absolutely necessary. Now a user can simply define their default license and quickly go through a form, as opposed to stopping to click on the select and choosing the same option over and over again. Also added DB migration for the field, so that's working now, too. Rebased by Sebastian and made the default value to be unicode. Reviewed-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* import db.sql.util -> db.utilSebastian Spaeth2013-01-171-1/+1
| | | | | | | Merging an old branch, I reintroduced an import of db.sql.util rather than db.util. Fixing the glitch. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Implement User.delete() (#540)Sebastian Spaeth2013-01-171-1/+22
| | | | | | | | | Set User.collections to her Collections using the backref feature. This way we can iterate a user's collections and delete them all. Delete all MediaEntries/Files/attachments/comments/collections etc before finally deleting the User object. This is the backend work for issue 302 (allow a user to delete ones own account)
* Implement Collection.delete()Sebastian Spaeth2013-01-171-1/+10
| | | | | | Deleting a Collection should automatically delete all containing items. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Implement MediaEntry().delete() (#540)Sebastian Spaeth2013-01-171-3/+36
| | | | | | | | | | | | Deleting a MediaEntry instance will automatically delete all related comments and files/attachments. This moves implementation logic out of views.py and allows to make use of this functionality when e.g. deleting a User() account. Whenever a MediaEntry entry is deleted, this will also sql-delete the corresponding MediaFile entry. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Mv db.sql.base to db.baseSebastian Spaeth2013-01-071-2/+1
| | | | | | | | This concludes the db.sql.* -> db.* move. Our db abstraction layer is sqlalchemy, so there is no need to a separate db.sql.* hierarchy. All tests have been run for each of the commit series to make sure everything works at every step.
* Move mediagoblin.db.sql.extratypes to mediagoblin.db.extratypesSebastian Spaeth2013-01-071-1/+1
| | | | No other functional changes.
* Move db.sql.models* to db.models*Sebastian Spaeth2013-01-071-0/+447
|
* Move db/models.py -> db/mongo/models.pyElrond2011-12-201-363/+0
| | | | | To my surprise, there was only ONE reference to models.py. From open.py.
* Move db/migrations.py -> db/mongo/migrations.pyElrond2011-12-201-1/+1
| | | | And change references.
* Move db/util.py -> db/mongo/util.pyElrond2011-12-201-1/+1
| | | | | - Change some reference - Provide a wrapper db/util.py
* 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
|
* 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-131-17/+18
|\ | | | | | | | | | | | | | | Conflicts: mediagoblin/db/migrations.py mediagoblin/db/models.py mediagoblin/user_pages/views.py mediagoblin/util.py
| * Whitespace and formatting cleanup.Nathan Yergler2011-10-011-17/+18
| | | | | | | | | | | | | | * Removed trailing whitespace * Line length < 80 where possible * Honor conventions on number of blank lines * Honor conventions about spaces around :, =
* | Finished splitting util.py into separate files.Aaron Williamson2011-10-011-7/+5
| |
* | Moved common, translation, template, and url code out of util.py and into ↵Aaron Williamson2011-10-011-2/+2
|/ | | | tools/[file].py
* Merge branch 'gullydwarf-cfdv-f357_lost_password_functionality'Christopher Allan Webber2011-09-081-0/+2
|\ | | | | | | | | Conflicts: mediagoblin/auth/routing.py
| * oops, uses Alejandro's fp_verification_key. my bad.Caleb Forbes Davis V2011-08-281-1/+1
| |
| * Adding fotgot password functionalityAlejandro Villanueva2011-08-281-0/+2
| |
* | 508. Updates copyright/license informationWill Kahn-Greene2011-09-011-1/+1
|/
* Method to get the failure exception object for a MediaEntry, if appropriate.Christopher Allan Webber2011-08-141-0/+7
|
* Add fail_error and fail_metadata fields to MediaEntry and relevant migrationChristopher Allan Webber2011-08-131-1/+9
|
* Merge branch 'master' into processingChristopher Allan Webber2011-08-111-6/+1
|\ | | | | | | | | Conflicts: mediagoblin/db/migrations.py
| * Bug #372 - MediaEntry.thumbnail_file not usedCaleb Forbes Davis V2011-08-101-6/+1
| | | | | | | | | | - deleted the thumbnail_file from the media_entries collection - added a migration to remove the field from previous db versions
* | Merge branch 'master' into processingChristopher Allan Webber2011-08-101-1/+1
|\|
| * Merge branch 'remotes/gullydwarf-cfdv/f360_tagging' (early part) into mergetagsChristopher Allan Webber2011-07-301-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: mediagoblin/config_spec.ini mediagoblin/edit/views.py mediagoblin/util.py
| | * changes tags to a list of dicts in the db, adding tag slugsCaleb Forbes Davis V2011-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | - adds a function to convert the tag list of dicts to a text string properly delimited for loading into forms - tag string conversion function updated to generate list of dicts - updates all mentions of the conversion of the string to the tags db object - adds a tags template utility and updates the media template accordingly
* | | Store the task id of a processing action in the database.Christopher Allan Webber2011-07-241-0/+3
|/ /
* | docstring for MediaComment's structureChristopher Allan Webber2011-07-171-1/+12
| |
* | Described the MediaEntry structure in the docstring.Christopher Allan Webber2011-07-171-6/+81
| |
* | Docstring for the User model's various schema fieldsChristopher Allan Webber2011-07-171-0/+26
| |
* | Merge remote branch 'remotes/jwandborg/feature_400-resize_images_to_fit_page'Christopher Allan Webber2011-07-161-0/+22
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mediagoblin/db/migrations.py mediagoblin/db/models.py mediagoblin/process_media/__init__.py mediagoblin/templates/mediagoblin/user_pages/media.html mediagoblin/util.py
| * | Removed debug code, erroneously included in my last commitJoar Wandborg2011-07-031-1/+1
| | |
| * | Feature #400 - Resize images to fit on page - AdditionsJoar Wandborg2011-07-031-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * `migrations.py` * Removed empty line * Added empty line * `models.py` * Added `MediaEntry.get_display_media()` helper function * `process_media.__init__.py` * Updated `process_media_initial()` * Renamed `main` => `original`. * Added condition to `medium`, it's only created if the original dimensions exceed the MEDIUM_SIZE dimensions. * `media.html` * The image tag is now populated by `MediaEntry.get_display_media()` * `util.py` * Added `DISPLAY_IMAGE_FETCHING_ORDER`, used by `MediaEntry.get_display_media()`
* | | Merge remote branch 'remotes/aaronw/feature410_markdown_bio'Christopher Allan Webber2011-07-131-1/+2
|\ \ \
| * | | Markdown-enable user bio (Feature 410)Aaron Williamson2011-07-101-1/+2
| | |/ | |/|
* / | Removing old style migrations... not in use anymoreChristopher Allan Webber2011-07-111-6/+2
|/ /
* | This should actually fix the next and previous buttons now. Sorry I borked ↵Christopher Allan Webber2011-07-071-2/+2
| | | | | | | | the merge!
* | Merge remote branch ↵Christopher Allan Webber2011-07-061-3/+3
|\ \ | | | | | | | | | | | | | | | | | | 'remotes/gullydwarf-cfdv/f423_match_image_ordering_between_scroll_and_gallery' Conflicts: mediagoblin/db/models.py
| * | Feature #423 - gallery and scroll image ordering matchCaleb Forbes Davis V2011-07-041-4/+4
| | |