aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db
Commit message (Collapse)AuthorAgeFilesLines
* created a check_login_simple functionRodney Ewing2013-05-251-8/+0
|
* changed User model pw_hash field to nullable and added migrationsRodney Ewing2013-05-242-1/+12
|
* Cleaned up EXIF viewJoar Wandborg2013-05-231-9/+23
| | | | | | The last update made the assumption that EXIF metadata is in some way consistent between camera models, images, manufacturers. This update takes into account that nothing is certain whenever EXIF is involved.
* Only calculate aperture if fnumber is providedJoar Wandborg2013-05-201-7/+6
|
* Take into account incomplete EXIF dataJoar Wandborg2013-05-201-9/+18
|
* Modifies EXIF section with Camera Info, display toggle and template stylingGabriel Saldana2013-05-201-0/+27
|
* Changes to display all EXIF informationGabriel Saldana2013-05-201-5/+3
|
* Noting why we don't have an email uniqueness constraint in the db.Christopher Allan Webber2013-05-171-0/+4
| | | | This commit sponsored by Guido Günther. Thanks!
* Make uuid look like a uuid.Elrond2013-04-271-1/+1
| | | | | | If we really have to create a visible uuid (for a slug in this case), don't try to hide the fact that it is a uuid. So format it like a uuid.
* Switch "sqlite_refcheck" keyword arg to "migrations" which Elrond thinks is ↵Christopher Allan Webber2013-04-261-3/+15
| | | | | | cleaner Also, if migrations is true, *explicitly* say that foreign key checking is off
* Don't turn on sqlite refcheck stuff during migrationsChristopher Allan Webber2013-04-261-2/+2
|
* Check for duplicate collection slugs and make them unique. Add unique ↵Rodney Ewing2013-04-242-2/+42
| | | | constraint to collection.slug model
* MediaManager: Use .foo instead of ['foo'].Elrond2013-04-171-1/+1
| | | | To make .media_fetch_order work, create a property.
* First step towards a MediaManager class: Compat one.Elrond2013-04-171-1/+1
| | | | | | To get us moving towards a MediaManager class, the first idea is to create a class that wraps our current dict based manager and makes all users happy.
* Use cascade for comment deletion.Elrond2013-04-081-7/+13
| | | | | Also use the relationship for getting the comments on a MediaEntry.
* Better docs for GenerateSlugMixin.Elrond2013-04-061-1/+9
|
* Use GenerateSlugMixin for collections.Elrond2013-04-062-13/+4
| | | | | Use the new way of generating slugs also for collections. Also drop the dummy_db arg to check_collection_slug_used.
* Refactor generate_slug into a mixin.Elrond2013-04-061-9/+13
| | | | | Refactor the new generate_slug into a mixin to allow it to be used for collections also.
* A bit of pep8: Remove useless whitespace.Elrond2013-03-301-5/+5
|
* Merge branch 'joar-skip_transcoding'Christopher Allan Webber2013-03-041-12/+16
|\
| * self.media_data->self.media_manager in the docstring. Thanks for catching, ↵Christopher Allan Webber2013-03-031-1/+1
| | | | | | | | | | | | Elrond. This commit sponsored by Sebastian Hugentobler. Thank you!
| * No reason really to pass in fetch_order anyway...Christopher Allan Webber2013-03-031-7/+5
| | | | | | | | | | | | | | I think this is legacy code from get_display_media being a utility, or something. Removed! (Thanks for pointing this out, Elrond!) This commit sponsored by Tristan Chambers. Thank you!
| * Huge amount of work to (mostly) allow .ogg (and maybe other) formats to skip ↵Christopher Allan Webber2013-03-021-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | transcode - Update get_display_media in several ways: - now uses the media type's own declaration of the order of things - returns both the media_size and the media_path, as per the docstring - implicitly uses self.media_files as opposed to forcing you to pass it in - update videos to use get_display_media - update images to declare media_fetch_order in the media manager (videos also) - update stl to use media.media_files['original'] instead of weird use of get_display_media - update sidebar to only conditionally show webm_640 TODO still: identify video type information *during* processing, show that in the <video><source /></video> element. This commit sponsored by Nathan Yergler. Thanks, nyergler!
* | Give a more useful error if a table already exists and so we can't create it ↵Christopher Allan Webber2013-03-041-1/+7
|/ | | | | | during migrations This commit sponsored by Andrzej Prochyra. Thanks!
* Simplifying the test for whether or not a user and slug combo exists.Christopher Allan Webber2013-02-271-3/+1
| | | | | | | Thanks to tchernobog for catching this (it was breaking on postgres) and Elrond for the suggestion on how to fix it. This commit sponsored by Caleb Cooper. Thanks Caleb!
* Media URLs with ids in them are now like /u/cwebber/m/id:4112/ rather than ↵Christopher Allan Webber2013-02-261-2/+4
| | | | | | | | /u/cwebber/m/4112/ This avoids some potential name collision issues. This commit sponsored by Asokan Pichai. Thank you!
* Import sqlalchemy's and_ and use it in our select statementChristopher Allan Webber2013-02-261-2/+3
| | | | This commit sponsored by Hans-Jörg Dollansky. Thank you!
* And of course, we need to actually commit at the end of a migration.Christopher Allan Webber2013-02-261-0/+3
| | | | This commit sponsored by Tamas Kemenczy. Thanks, Tamas!
* Dope'ily missed .count() on the query where we're countingChristopher Allan Webber2013-02-251-1/+1
| | | | | | Thanks for catching, Elrond. This commit sponsored by Graham King. Thank you!
* Supplying migrations for a bold new era of mediagoblin entry slugsChristopher Allan Webber2013-02-251-0/+54
| | | | | | | | | | | | | | | | Okay, that's a totally confusing statement, but the docstring of this migration summarizes it well: Entries without slugs now display differently in the url like: /u/cwebber/m/id=251/ ... because of this, we should back-convert: - entries without slugs should be converted to use the id, if possible, to make old urls still work - slugs with = (or also : which is now also not allowed) to have those stripped out (small possibility of breakage here sadly) This commit sponsored by John Sullivan. Thanks johnsu01! :)
* Fix deleting media with attachments.Elrond2013-02-181-0/+1
| | | | | | | | | | | | | | If one deletes a media with attachments, there have been various problems: 1) If the file in the storage did not exist any more (maybe because due to a previous deletion attempt?), the error propagation failed, because the wrong thing was gathered. 2) The attachment database entries were not deleted. Using cascade for this, for now. Also add a simple unit test, that tests both by having a broken attachment on a media.
* Drop backward compatibility for media_data backref.Elrond2013-02-011-9/+1
| | | | Now we only support media_type backrefs with uselist=False.
* Drop media_data_table property.Elrond2013-02-011-6/+3
| | | | | Only when creating a new media_data row, we need the table. So load that locally in media_data_init().
* Rewrite media_data handling to use relationshipsElrond2013-02-011-20/+21
| | | | | | | | | | | | | | | | | | Instead of doing query by hand, use the relationships on the models to find the media_data. Is is made possible by the BACKREF_NAME in each models.py, which lets us know the local attr to ask for. Also initialize the relationship attribute on new media_data instead of the media_id. Also do not add it to the session. This gives us: - This automatically initializes the other side of the relationship, which will allow later acces via that way. - If the media_data is too early in the session, when the (new) media_entry is not yet in there, this could get conflicts. Avoid those by not adding to session. - Uses cascading to commit media_data together with the media_entry.
* Fix issue 611: Proper (back)relationship on MediaComment.Elrond2013-01-291-1/+7
| | | | well, fix the relationship on the comments.
* Merge branch '216_cwebber_style_unique_slugs'Christopher Allan Webber2013-01-251-9/+61
|\
| * New mediaentry slug tests now pass!Christopher Allan Webber2013-01-231-3/+4
| | | | | | | | | | | | - fixed some issues with "whacking uuid junk on the slug" - uuid4() -> uuid.uuid4() so that mock will work right - added all the tests!
| * We don't want any empty string slugs, so make "" -> NoneChristopher Allan Webber2013-01-231-0/+4
| |
| * Switching uuid4()[1:4] -> uuid4().hex[:4]Christopher Allan Webber2013-01-231-1/+1
| | | | | | | | | | | | .hex is what we need to access to get at the ascii (hex) version anyway. Also, not sure why the previous version grabbed starting at the index of 1... just grab the first characters instead.
| * Simplifying string concatenation in generate_slug and fixing docstringChristopher Allan Webber2013-01-151-5/+7
| | | | | | | | | | | | | | | | - made the mistake of copying some commit message things into the docstring. Fixed. - elrond points out that += is nicer and we don't need u"" in this case since we're not concatenating a variable, we're concatenating a known ascii string.
| * A revised algorithm for generating slugs.Christopher Allan Webber2013-01-151-11/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This one does not *force* slugs, but usually it will probably result in a niceish one. The end *result* of the algorithm will (presumably, I have not tested it) result in these resolutions for these situations: - If we have a slug, make sure it's clean and sanitized, and if it's unique, we'll use that. - If we have a title, slugify it, and if it's unique, we'll use that. - If we can't get any sort of thing that looks like it'll be a useful slug out of a title or an existing slug, bail, and don't set the slug at all. Don't try to create something just because. Make sure we have a reasonable basis for a slug first. - If we have a reasonable basis for a slug (either based on existing slug or slugified title) but it's not unique, first try appending the entry's id, if that exists - If that doesn't result in something unique, tack on some randomly generated bits until it's unique. That'll be a little bit of junk, but at least it has the *basis* of a nice slug!
| * Need to import uuid4 for generate_slug to totally workChristopher Allan Webber2013-01-151-0/+2
| |
| * Make generate_slug assign a slug in any caseSebastian Spaeth2013-01-151-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | generate_slug could assign "none" as slug. Make sure it assigns a unique slug in any case. We now try based on: a) existing slug values b) media.title c) media.id d) random garbage Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | 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.
* | Use inspect_table; default user license==None.Elrond2013-01-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use inspect_table in the new migration. Makes code more readable, really. And make the default for the preferred license be None. This is a userspace thing, so we can even change the migration here. Changing the migration means, that people running the migration before this commit get a "" in User.license_preference, while people running the migration now get a None. Both values are okay. None has been designated as "Use the site's default". We're not actually having a site default right now. Which means no license is selected in the dropdown. While "" means "All rights reserved" being chosen by the user. Side note: Having no license being selected in the submit dropdown is as "worse" as before and does not really hurt much. MediaEntry.license==None means "All rights reserved" as does "" also do.
* | Merge remote-tracking branch 'refs/remotes/spaetz/521_license_preference' ↵Christopher Allan Webber2013-01-222-0/+13
|\ \ | | | | | | | | | into mergetest
| * | Add a license preference fieldMark Holmquist2013-01-172-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Enable foreign key checking on sqlite.Elrond2013-01-181-1/+12
|/ / | | | | | | | | | | sqlite normally does not check foreign key referential integrity. But it can do so. So let's use it. Better safe than sorry.
* | 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)