| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
I needed to split the db connection/opening into open.py,
due to an import loop:
- util.py needs db/util.py:ObjectId
- db/util.py would need db/models.py
- db/models.py needs util.py:slugify
|
|
|
|
| |
from_celery
|
| |
|
| |
|
|
|
|
|
|
| |
We used to import those from pymongo and mongokit directly.
We should import them from a single place. So let's try
db.util for this.
|
|
|