1536 Commits

Author SHA1 Message Date
Jef van Schendel
694e965f45 Fix #712: Comment counter always uses plural 2011-12-30 20:17:59 +01:00
Jef van Schendel
6f55906078 Fix #715: On media submit page, "Separate" is misspelled 2011-12-30 19:45:00 +01:00
Jef van Schendel
550d48d040 Forgot to include the newly created JS file 2011-12-29 22:56:42 +01:00
Jef van Schendel
4e9d467fc0 Isolate JavaScript; add new show_password.js to forgot-password-page as well 2011-12-29 22:54:31 +01:00
Jef van Schendel
dab1d70280 Finished #485 and worked out bugs: password fields always update, added margins, fixed Chrome width bug, wrapped checkbox in label element 2011-12-29 22:40:45 +01:00
Elrond
9f264942d8 Add a .save method on the sql db objects
This is a shortcut to adding the object to a session (if
needed) and giving a commit on the session.

In reality, calling code should probably utilize the
session on its own and call commit in an appropiate place.
2011-12-29 10:41:50 +01:00
Elrond
03c2286232 Support .get(fieldname) on sql db objects
Some parts of the code like to call .get("somefield") on
the db objects.  It's easy to support this on sqlalchemy
based objects, so lets do it.
2011-12-29 00:14:47 +01:00
Elrond
690672580e Fix "bin/gmg migrate" after mongo move
When moving most stuff from db to db/mongo, "gmg migrate"
was left out.

Fix it now!
2011-12-28 23:46:36 +01:00
Elrond
0724930a68 Show --log-file option in lazyserver help. 2011-12-28 23:27:46 +01:00
Elrond
88e90f41eb SQL Model: Add relationship properties
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.
2011-12-28 22:58:44 +01:00
Elrond
c6263400cf SQL Model: Forgot MediaEntry.state field
While creating the new SQL model, the "state" field of
MediaEntry was left out. Currently using a plain unicode
string for it.

Maybe should use sqlalchemy.types.Enum?
2011-12-28 22:58:32 +01:00
Elrond
19ed039ba6 Implement _id proxy on sql objects (on User for now)
So that the old code can access the primary key still as
"._id".

Quite simple Python Descriptor thing.
Very generic.
2011-12-28 22:26:00 +01:00
Elrond
0575175846 Turn media.get_uploader into a property
sqlalchemy gives autoloading (hopefully caching) link to
other objects as properties. So turn get_uploader on the
current mongo based stuff into a property to ease
transition.
2011-12-27 20:41:31 +01:00
Elrond
0eb649ff7a Use media.url_for_self instead of calling urlgen directly
Replace
	urlgen('ID', user=media.get_uploader().username, media=media.*)
by
	media.url_for_self(urlgen)
in a few places.
It's just a lot nicer!
2011-12-27 20:41:31 +01:00
Elrond
479e8a833b Move verification key generation to view
Instead of creating the email verication key on the db
model as a default for the field, create it in the
registration view.
Now all verification key generation is only in
auth/views.py!
2011-12-27 20:17:16 +01:00
Elrond
0c0ab32274 Translate one string
"There doesn't seem to be any media here yet..." is now
translated also here (it's already in the list from another
place).
2011-12-25 20:12:59 +01:00
Elrond
4deda94a38 Replace media.get_uploader()._id by media.uploader
media.get_uploader()._id loads a complete user object
without actually needing it, because media.uploader already
has the id!
2011-12-24 19:27:29 +01:00
Elrond
4305580e85 Improve .one() by using sqlalchemy's .one() 2011-12-24 19:11:42 +01:00
Elrond
2608982885 Add search level one() method
And create a _fix_query_dict which converts '_id' to 'id'.
2011-12-24 19:11:12 +01:00
Elrond
fb7dd855de Turn MediaComment's author() into get_author property
1) MediaComment's author method conflicts with the author
   field. So rename it to get_author.
2) Turn it from a normal function into a python property.
   That means you call it by ".get_author" not by
   ".get_author()". This is exactly what sqlalchemy gives
   us free of charge.
2011-12-23 22:25:06 +01:00
Karen Rustad
db425022dd added translation tags to html5 wwarning 2011-12-23 17:28:31 +01:00
Karen Rustad
6c191eb3de Added a 'you don't have HTML5 so this video will not work' warning using just the inherent properties of the <video> tag (and some css for style) 2011-12-23 00:26:00 +01:00
Elrond
d23d4b23da Note reported bug in workaround
So that the workaround can eventually be removed, note the
URL for the relevant bug in a comment.
2011-12-21 00:34:02 +01:00
Elrond
871fc591dd Workaround for Routes/urlgen bug.
This is relevant for fcgi:

Some servers (cherokee for example) put "HTTP":"off" in the
environ. And the following code in urlgen breaks on this:
    if environ.get('HTTPS') or environ.get('wsgi.url_scheme') == 'https' \
       or environ.get('HTTP_X_FORWARDED_PROTO') == 'https':
        hostinfo['protocol'] = 'https'

workaround is to remove HTTPS:off from the environ.
2011-12-21 00:06:38 +01:00
Elrond
463a5dcc43 Merge remote branch 'remotes/joar/webfinger'
* remotes/joar/webfinger:
  Added references to docstring in mediagoblin.webfinger
  Removed mediagoblin.tools.feed which was accidentally included
  Polishing the webfinger implementation
  webfinger fully compliant with webfinger.org! Still *preliminary* solution.
  Changed some thngs to be compatible with webfinger.org, still *very preliminary*
  Added *very preliminary* support for webfinger
2011-12-20 22:58:16 +01:00
Joar Wandborg
85c916919b Added references to docstring in mediagoblin.webfinger
and mediagoblin.webfinger.views [references mediagoblin.webfinger]
2011-12-20 22:55:13 +01:00
Joar Wandborg
448a58534f Removed mediagoblin.tools.feed which was accidentally included 2011-12-20 22:13:43 +01:00
Joar Wandborg
c8cb0ee88f Polishing the webfinger implementation
- Changed quotes in the templates from " to '
- Changed all link generation to use request.urlgen
- Moved xrd links data generation from template to view
- Added parsing of the account URI using urlparse
2011-12-20 22:06:36 +01:00
Elrond
4ae4012dad Move db/models.py -> db/mongo/models.py
To my surprise, there was only ONE reference to models.py.
From open.py.
2011-12-20 20:41:21 +01:00
Elrond
faf74067da Move db/migrations.py -> db/mongo/migrations.py
And change references.
2011-12-20 20:33:33 +01:00
Elrond
59bd06aabb Move db/util.py -> db/mongo/util.py
- Change some reference
- Provide a wrapper db/util.py
2011-12-20 19:35:47 +01:00
Elrond
4970960f8c Move db/indexes.py to db/mongo/indexes.py
And change references (one!).
2011-12-20 19:20:09 +01:00
Elrond
046f9f8481 Move db/open.py to db/mongo/open.py
Starting to move the mongo specific stuff into db/mongo.
And create thin "from db.mongo.Y import z" wrappers in
db/Y.py.

Why?
1) Will make it lots easier to switch to sql for
   testing/developing.
2) The mongo stuff needs to stay around after moving to
   sql, because the converter needs it.
2011-12-20 19:06:04 +01:00
Elrond
7b194a79f0 SQL: mongokit like interface
In trying to ease the migration to SQL, created an
interface to sqlalchemy that looks a lot like the interface
that is currently in use.

*WARNING* Work in progress
2011-12-18 17:07:15 +01:00
Jef van Schendel
18517e888a Show actual comment number. Only shows plural for now (ticket #712) 2011-12-18 00:31:39 +01:00
Elrond
dbcf5289dc Simple Mongo -> SQL migration tool
This is just a start at a Migration tool from Mongo to SQL.
It fills all currently available SQL models with data from
MongoDB. A few fields in the SQL tables are left out,
because some data format migrations are needed (notably:
queue_file_name).

This thing lives in mediagoblin/db/sql/convert.py because
it has a lot of stuff hardcoded and is not, repeat not for
end users!

Hard coded:
- output database: ./mediagoblin.db (sqlite)
- Mediagoblin config: ./mediagoblin.ini
2011-12-17 21:37:02 +01:00
Elrond
7c2c56a5ff Little sql model update
- Add title to the MediaEntry
- Rename fp_verification_expire to fp_token_expire to
  follow the mongo model.
2011-12-17 17:34:55 +01:00
Joar Wandborg
8eb216388f Fixed import_export
- Mongokit instead of pymongo
- db.MediaEntry instead of db.media_entry (pymongo style)
2011-12-15 23:49:52 +01:00
Elrond
e365f980ac SQL: Some toys and little fix
Run bin/python mediagoblin/db/sql/models.py and watch the
create tables on a memory sqlite db.

Also unicode strings need unicode defauls. Warning by
sqlalchemy.
2011-12-15 22:11:49 +01:00
Elrond
a8ae9a29c1 Move sql models into db/sql/
So we can play with the sql models, let's put them in a
proper place.
2011-12-15 21:15:21 +01:00
Elrond
a0033abb9b Merge remote branch 'remotes/cwebber/sqlalchemy'
* remotes/cwebber/sqlalchemy:
  Beginnings of sqlalchemy models
2011-12-15 21:10:01 +01:00
Joar Wandborg
9df07e87a8 webfinger fully compliant with webfinger.org! Still *preliminary* solution. 2011-12-15 19:35:53 +01:00
Will Kahn-Greene
8d45c4463b Fix -dev version and add version number docs
Version numbers should adhere to PEP-386.
2011-12-15 09:28:48 -05:00
Joar Wandborg
830a78cdfb Changed some thngs to be compatible with webfinger.org, still *very preliminary* 2011-12-15 00:58:14 +01:00
Joar Wandborg
9c1c6c2a61 Added *very preliminary* support for webfinger 2011-12-15 00:46:10 +01:00
Jef van Schendel
31f5c4567f Change "Submit" to "Add" for ticket #466 2011-12-14 16:42:40 +01:00
Jef van Schendel
cd4b519a78 Remove "X license" placeholder from media page 2011-12-14 16:36:29 +01:00
Jef van Schendel
bb298cde80 Change wording for change_fp; improved the button text 2011-12-14 16:18:26 +01:00
Elrond
8d52214f1e Merge remote branch 'joar/b681-comments_from_reviewing_video'
* joar/b681-comments_from_reviewing_video:
  Bug 681 - Comments from reviewing the new video merge
2011-12-13 21:35:15 +01:00
Jef van Schendel
bb3b9e4090 Merge jQuery branch, resolve conflicts 2011-12-13 15:15:57 +01:00