| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
It was only used for the model._id -> model.id conversion and is not
needed anymore.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were refering to model._id in most of the code base as this is
what Mongo uses. However, each use of _id required a) fixup of queries:
e.g. what we did in our find() and find_one() functions moving all
'_id' to 'id'. It also required using AliasFields to make the ._id
attribute available. This all means lots of superfluous fixing and
transitioning in a SQL world.
It will also not work in the long run. Much newer code already refers
to the objects by model.id (e.g. in the oauth plugin), which will break
with Mongo. So let's be honest, rip out the _id mongoism and live with
.id as the one canonical way to address objects.
This commit modifies all users and providers of model._id to use
model.id instead. This patch works with or without Mongo removed first,
but will break Mongo usage (even more than before)
I have not bothered to fixup db.mongo.* and db.sql.convert
(which converts from Mongo to SQL)
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
| |
|
|
|
|
|
| |
Sends an HTTP POST request back to an URL given on submission to the API
submit view.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
THE MIGRATIONS SUPPLIED WITH THIS COMMIT WILL DROP AND RE-CREATE YOUR
oauth__tokens AND oauth__codes TABLES. ALL YOUR OAUTH CODES AND TOKENS
WILL BE LOST.
- Fixed pylint issues in db/sql/migrations.
- Added __repr__ to the User model.
- Added _disable_cors option to json_response.
- Added crude error handling to the api.tools.api_auth decorator
- Updated the OAuth README.
- Added client registration, client overview, connection overview,
client authorization views and templates.
- Added error handling to the OAuthAuth Auth object.
- Added AuthorizationForm, ClientRegistrationForm in oauth/forms.
- Added migrations for OAuth, added client registration migration.
- Added OAuthClient, OAuthUserClient models.
- Added oauth/tools with require_client_auth decorator method.
|
| |
|
|
|
|
|
| |
The __repr__() call would crash the process when it tried to convert an
unicode title to ASCII for terminal/logfile output.
|
|
|
|
|
|
|
|
|
|
| |
- Added progress meter for video and audio media types.
- Changed the __repr__ method of a MediaEntry to display a bit more
useful explanation.
- Added a new MediaEntry.state, 'processing', which means that the task
is running the processor on the item currently.
- Fixed some PEP8 issues in user_pages/views.py
- Fixed the ATOM TAG URI to show the correct year.
|
|
|
|
| |
This commit makes test_submission mostly warning-clean.
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
'is_derek/bug405_email_notifications_for_comments' into notifications-merge
Conflicts:
mediagoblin/db/mongo/migrations.py
|
| |\
| | |
| | |
| | |
| | | |
Conflicts:
mediagoblin/db/mongo/migrations.py
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When creating a new media_data row, the new row needs to
know the MediaEntry it is associated with. I have no idea,
why this worked before at all. Maybe some implicit tricks
by sqlalchemy?
|
| |/
|/|
| |
| |
| | |
These are the columns that seem to make the most sense to
have an index on them.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If there is no media_data row for the current media (for
whatever reason, there might be good ones), let
MediaEntry.media_data not raise an exception but just
return None.
The exif display part now handles this by checking whether
.media_data.exif is defined (None has no attribute exif, so
it's undefined, all fine).
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The name part of a MediaFile is only using a very limited
number of items. Currently things like "original" or
"thumb".
So instead of storing the string on each entry, just store
a short integer referencing the FileKeynames table and have
the appropiate string there.
|
| |
|
|
|
|
| |
Needs to be implemented.
|
|
|
|
|
|
|
| |
So that the SQL backend is more useable, let the MediaEntry
have a faked media_data.
It's extremely fake: The returned dict is always a new one.
So any stored info is even lost!
|
|
|
|
|
|
|
|
|
| |
attachments working with the sql backend.
- SQL Schema for attachment files, ordering attachments by
their name, not by the submission order (as earlier).
- Dot-Notation for attachments, where missing.
- convert existing attachments over from mongo -> sql
|
|\ |
|
| |
| |
| |
| |
| | |
Let the init code also handle createing a fresh clean
instance without any attrs set.
|
| |
| |
| |
| |
| |
| |
| |
| | |
fail_metadata used to be a dict in mongo. So a json encoded
field should be okay too.
We could use a pickled field instead, which would be more
flexible.
|
|\|
| |
| |
| |
| | |
Conflicts:
mediagoblin/db/sql/models.py
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After a bit of discussion, we decided to drop the
pre-rendered html from the database and render it on
the fly.
In another step, we will use some proper caching method to
cache this stuff.
This commit affects the MediaComment.content_html part.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After a bit of discussion, we decided to drop the
pre-rendered html from the database and render it on
the fly.
In another step, we will use some proper caching method to
cache this stuff.
This commit affects the MediaEntry.description_html part.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After a bit of discussion, we decided to drop the
pre-rendered html from the database and render it on
the fly.
In another step, we will use some proper caching method to
cache this stuff.
This commit affects the User.bio_html part.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Many thanks go to Svavar Kjarrval who has taken a deeper
look at our current sql db design and made a bunch of
suggestions. The suggestions are currently put as TODO
items in the docstrings. This way we can keep track of
them directly where we need it.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
- Add default for User.email_verified
- Add default for MediaEntry.state
- Let PathTupleWithSlashes store [] as "NULL",
but not handling the reverse properly yet!
- Add _id alias field to MediaEntry and MediaComment
|
| | |
|
| | |
|
|/
|
|
| |
Things definitely don't work yet, but should be heading in the right direction.
|
|
|
|
|
|
|
|
|
|
|
| |
These changes allow all of the rest of the code to use tags
in sql as they were used on mongo. It's not efficient at
all, as changing tags usually means to remove all old tags
and adding all new.
The only problem here is: Old slugs for tags are not
removed, because they're shared across all MediaTags and
dropping orphans is not always easy.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The upcoming SQL database will allow having media without a
slug again. This might especially be useful for API
support, where the uploaded image (media) does not have
*any* information to generate a slug from.
This code change mostly allows the sql backend to have no
slug in its model and improves some parts to properly
handle that.
It specifically does not have any web frontend support to
edit/create MediaEntries with no slug.
|
|
|
|
| |
The base class of all models "Base" should be in base.py.
|
|
|
|
| |
Uses complete sqlalchemy syntax now.
|
|
|
|
|
| |
Using proper sqlalchemy syntax instead of the emulated
mongo one.
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Nearly all the sql files missed a copyright header.
So added it!
And while there fixed a few pep8 things.
|
|/
|
|
| |
translation tags to license template.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- This adds a new SQL table field type for path tuples.
They're stored as '/' separated unicode strings.
- Uses it to implement a MediaFile table.
- Add relationship and proxy fields on MediaEntry to give a
nice media_files "view" there.
- Let the converter fill the MediaFile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|