| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
- Adds a "type" column to the Collection object and allows the
CollectionItem model to contain any object.
- Changes "items" to "num_items" as per TODO
- Renames "uploader", "creator" and "user" to a common "actor" in most places
|
| |
|
|
|
|
| |
This commit sponsored by Francois Marier. Thank you!
|
| |
|
| |
|
|
|
|
| |
.one calls over to SQLAlchemy queries
|
|
|
|
|
| |
Use the new way of generating slugs also for collections.
Also drop the dummy_db arg to check_collection_slug_used.
|
|
|
|
|
|
|
| |
Remove the unused dummy_db argument and generally make the function
readable.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
|
|
|
|
|
| |
Factor all the migration related stuff out into a new
.db.sql.migration_tools.
First we don't have to load this module for our normal
server.
Second it makes all the import dependencies a little more
cleaner.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
Now that sqlalchemy is providing the database abstractions, there is no
need to hide everything in db.sql. sub-modules. It complicates the code
and provides a futher layer of indirection.
Move the db.sql.util.py to db.util.py and adapt the importers.
|
|
|
|
|
|
|
|
| |
This is the last remnant that requires us to keep db.sql.fake.py. Use
ModelName.desc() or sqlalchemy.sql.expression.desc(column) to achieve
descending sorts.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
|
|
|
| |
This was one of the last remaining Mongo holdouts and has been removed from
the tree herewith. Good bye, ObjectId.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
|
|
| |
It was a NoOp in our Non-mongo world. So it is safe to remove.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
|
|
|
|
|
| |
Since sqlalchemy is providing our database abstraction and we have
moved away from Mongo as the underlying database, it is now time to
simplify things and rip out mongo. This provides the bulk of the
changes, and can stand on its own. There are some followup tasks
that can be done, such as removing now unneeded abstraction layers,
e.g. db.sql.fake.py
|
| |
|
|
|
|
|
|
|
|
|
| |
Searching media by slug is easy on mongo. But doing the
joins in sqlalchemy is not as nice. So created a function
for doing it.
Well, and create the same function for mongo, so that it
also works.
|
|
|
|
|
|
|
|
| |
In two cases (generating a new slug and editing the slug)
it is nice to know in advance (before the db gets angry)
that the slug is used/free. So created a db utility
function to check for this on mongo and sql:
check_media_slug_used()
|
|
|
|
|
|
| |
On sqlalchemy most updates are atomic enough for most use
cases. Anyway, here is an atomic_update that is compatible
to the mongo version.
|
|
|
|
|
|
|
|
|
| |
In some cases (notably the mark_entry_failed function) it
is useful to have atomic update functionality on the db. On
mongo this requires special syntax.
So created an atomic_update function for mongo and started
to use it in mark_entry_failed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you want to play with the current state of sql, you need
a switch to turn it on. So here is the super secret
developer switch.
So you want to know where it is?
Here it is:
Create a file mediagoblin/db/sql_switch.py and put one line
in it: "use_sql = True" (or False to disable again). Right,
that's it. If you want to delete it, remember to delete the
*.pyc too.
Be careful not to "git add" it by accident!
|
|
|
|
|
|
| |
Inside the mongo db backend, use the mongo
MigrationManager. This is hopefully the last reference to
the generic MigrationManager reference on db.util.
|
|
|
|
|
| |
- Change some reference
- Provide a wrapper db/util.py
|
|
|
|
| |
And change references (one!).
|
| |
|
|
|
|
|
|
|
| |
* Removed trailing whitespace
* Line length < 80 where possible
* Honor conventions on number of blank lines
* Honor conventions about spaces around :, =
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
mediagoblin/db/open.py
|
| |
| |
| |
| | |
indexes around.
|
| | |
|
| |
| |
| |
| | |
Thanks for the catch, Elrond.
|
| |
| |
| |
| | |
version if missing, migrations_to_run just throws an error if not set
|
| | |
|
| |
| |
| |
| |
| | |
This means there's a serious side effect of calling this, but there's
no way to get useful data here unless if that's set anyway.
|
| |
| |
| |
| |
| | |
Also added it to MigrationManager.migrate_new(), because we'll always
need a migration number when migrating.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Allows for calbacks, should be useful for printing output and catching
things in tests.
Gets rid of the generator stuff which now that I think of it is a
messy idea.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
| |
I think it's looking right though.
- Provides MigrationManager which should have plenty of utilities for
doing migrations hopefully correctly :)
- Provides RegisterMigration which should be able to decorate
migrations and register them in doing so
|
|
|
|
|
|
|
|
| |
Feature #401 - previous/next navigation on media pages
* media.html includes a new prev_next.html template containing the links
* prev_next.html calls functions added to the media model to retrieve
the appropriate objects from the database, formatted with urlgen
* a small change to util.py brings ASCENDING into the mix
|
|
|
|
|
|
|
|
|
|
| |
arguments
More specifically, we now just take a dictionary of lists, like:
{'collection': ['index_identifier1', 'index_identifier2']}
Previously we took something with more info like in add_new_indexes,
but that extra info isn't really necessary.
|
| |
|
|
|
|
|
|
| |
Instead of import InvalidId from the low level bson module,
first import it in our db.util wrapper and second import it
from pymongo.errors.
|