600 Commits

Author SHA1 Message Date
Joar Wandborg
380ac094f6 Removed debug code, erroneously included in my last commit 2011-07-03 06:37:40 +02:00
Joar Wandborg
2c9e635ae2 Feature #400 - Resize images to fit on page - Additions
*   `migrations.py`
    *   Removed empty line
    *   Added empty line
*   `models.py`
    *   Added `MediaEntry.get_display_media()` helper function
*   `process_media.__init__.py`
    *	Updated `process_media_initial()`
    	*   Renamed `main` => `original`.
	*   Added condition to `medium`, it's only created if the original
	    dimensions exceed the MEDIUM_SIZE dimensions.
*   `media.html`
    *	The image tag is now populated by `MediaEntry.get_display_media()`
*   `util.py`
    *	Added `DISPLAY_IMAGE_FETCHING_ORDER`, used by `MediaEntry.get_display_media()`
2011-07-03 05:46:00 +02:00
Christopher Allan Webber
230e1bd770 Merge remote branch 'remotes/gullydwarf-cfdv/f401_prev_next_media_nav'
Conflicts:
	mediagoblin/db/models.py
	mediagoblin/templates/mediagoblin/user_pages/media.html
2011-07-02 21:16:39 -05:00
Christopher Allan Webber
a24dbd451c Note from Chris Webber prefacing Elrond's DB abstraction idea. 2011-07-02 17:05:13 -05:00
Christopher Allan Webber
c0d532f04e Merge remote branch 'remotes/elrond/idea/db_doc' 2011-07-02 17:01:43 -05:00
Christopher Allan Webber
2110408f44 Merge remote branch 'remotes/jwandborg/feature_362-simple_comments-acts_on_feedback'
Conflicts:
	mediagoblin/templates/mediagoblin/user_pages/media.html
2011-07-02 14:39:35 -05:00
Caleb Forbes Davis V
9c0fe63fad adds previous and next links in the sidebar
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
2011-07-02 06:15:58 -05:00
Joar Wandborg
6f59a3a324 Issue #362 - Simple comments - Changes based on feedback recieved from #mediagoblin
*   `db.models` - Removed `MediaEntry.get_comments()` and replaced it with a helper
    which just returns a cursor for the comments query
*   `media.html` - Added `{% set comment_author = comment.author() %}`
*   `user_pages.views` - media_home() now passes `MediaEntry.get_comments()`
    directly to `Pagination`, handles pagination for comments.
    *   Added `MEDIA_COMMENTS_PER_PAGE` to define the number of comments per page
        in the `media_home()` view.
2011-07-01 15:26:29 +02:00
Elrond
3f9d93407b Document the db submodule a bit
Document the ideas behind the db submodule.
And document what that actually means.
2011-06-30 23:27:52 +02:00
Christopher Allan Webber
a98104eb39 Comment indexes 2011-06-30 12:51:32 -05:00
Christopher Allan Webber
216cd9c85c Merge remote branch 'remotes/jwandborg/feature_362-simple_comments' 2011-06-29 20:27:48 -05:00
Joar Wandborg
47f524f67d Merge branch 'feature_362-simple_comments' 2011-06-29 16:12:33 +02:00
Joar Wandborg
7bd8197f32 Issue #362 - Updated the MediaComment model
*   `MediaComment.get_comments()` now uses pagination
*   `MediaComment.get_comments()` now sorts by `created` DESC
*   `MediaComment.media_entry` is now **required**
*   `MediaComment.media_entry()` now returns parent `MediaEntry`
2011-06-29 01:16:51 +02:00
Christopher Allan Webber
2527754202 Documenging index utils and adjusting how remove_deprecated_indexes gets 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.
2011-06-27 20:48:35 -05:00
Christopher Allan Webber
1f7749995d Documentation updates to indexes.py's docstring
Includes information on how to deprecate indexes.
2011-06-27 20:40:31 -05:00
Christopher Allan Webber
b1db6f20dd Adding our current indexes and removing the index that was in models.py 2011-06-27 16:56:41 -05:00
Christopher Allan Webber
0f3167c9f0 Tools to add / remove indexes from collections 2011-06-27 16:56:12 -05:00
Joar Wandborg
c11f21ab3c Issue 362 - Add simple comments
*   Added MediaComment database model
    Holds `media_entry` (`ObjectId`), `author` (`ObjectId`), `created`, `content` and `content_html`.
2011-06-27 23:39:40 +02:00
Christopher Allan Webber
ca5d2c51b6 Store the collection information in the ACTIVE_INDEXES keys 2011-06-26 21:51:38 -05:00
Christopher Allan Webber
3cd6ea5b17 A base set of indexes for us to use with our new indexing tool. 2011-06-26 21:10:16 -05:00
Christopher Allan Webber
cf383901a9 Merge remote branch 'remotes/elrond/idea/invalidid' 2011-06-22 09:52:13 -05:00
Christopher Allan Webber
3208bea54c Merge remote branch 'refs/remotes/gullydwarf-cfdv/is315' 2011-06-21 23:22:16 -05:00
cfdv
0472653ee4 assigns migration steps to User database objects
adds the migration_handler to the User db class, connecting the
migration steps in ../db/migrations.py to the migration code in
gmg_commands
2011-06-20 22:48:25 -05:00
Christopher Allan Webber
a2c37d0a78 Only migrate to description_html if description also exists. 2011-06-20 21:02:46 -05:00
cfdv
17bb7c388b removes unecessary dependence on existence of username for User migration01, + fix whitespace issues 2011-06-20 19:28:02 -05:00
cfdv
e36ecab093 adds accommmodations for migration of fields in User: bio and url 2011-06-20 13:07:15 -05:00
cfdv
78c0744077 Merge remote-tracking branch 'origin/master' into is315 2011-06-20 12:50:44 -05:00
Christopher Allan Webber
a01d04a017 Provide a migration to add description_html to MediaEntries that don't have it 2011-06-19 20:42:48 -05:00
Elrond
3efdd97c2e Move InvalidId to db.util
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.
2011-06-20 00:09:40 +02:00
cfdv
630b57a366 baby step towards enabling profile edits
adds
* url and bio fields to database
* form for editing the user profile
* route to the edit profile controller
* view for the profile editing page
* template for the profile editing page
* link to edit profile in the welcome page

still needs
* thorough inspection to see if it makes sense
* tests
* ?
2011-06-18 16:42:22 -05:00
cfdv
279d925e75 adds user bio and website url fields to the database 2011-06-18 15:00:05 -05:00
Joar Wandborg
9e883ed3b2 Merge branch 'master' of http://git.gitorious.org/mediagoblin/mediagoblin 2011-06-15 22:18:24 +02:00
Christopher Allan Webber
6e7ce8d1af mediagoblin.globals->mediagoblin.mg_globals 2011-06-12 17:27:37 -05:00
Joar Wandborg
44e2da2fe6 Added Markdown rendering for media_entry 2011-06-12 03:24:31 +02:00
Christopher Allan Webber
a77d952aa6 No need for a method for generating the verification key as a method
on the class, can just do that in the view
2011-06-02 09:02:13 -05:00
Christopher Allan Webber
d9951a6e03 Merge remote branch 'remotes/aleks/aleks' 2011-05-31 19:17:28 -05:00
Aleksandar Micovic
b93a6a229e Added the ability to regenerate a verification key. 2011-05-31 17:14:23 -04:00
Christopher Allan Webber
b1ae76aea0 Add an index on MediaEntries making sure slugs + uploader combos are unique 2011-05-30 18:06:12 -05:00
Jakob Kramer
db5912e358 remove all 'username_repr' stuff 2011-05-29 19:49:25 +02:00
Jakob Kramer
ce72a1bb15 this should fix #354 2011-05-29 19:15:46 +02:00
Christopher Allan Webber
16509be160 Update all the views so that they use the uploader reference instead
of uploader embedding
2011-05-22 16:06:45 -05:00
Christopher Allan Webber
757f37a52d User migration works (but the rest of the system isn't updated for new user setup yet) 2011-05-22 10:52:53 -05:00
Christopher Allan Webber
6926b23d43 Added a url_for_self method for generating mediaentry links
This allows for optionally making the url based off of slugs or ids
2011-05-20 18:16:10 -05:00
Elrond
a67fec8177 Factor out most of the database connection into db/open.py
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
2011-05-19 01:35:02 +02:00
Christopher Allan Webber
3262ad1dbb Renaming connect_database to connect_database_from_config and using in from_celery 2011-05-18 08:44:57 -05:00
Christopher Allan Webber
468bc8afce Need to import asint for users who specify ports via config file 2011-05-18 08:39:09 -05:00
Christopher Allan Webber
1815f5ce2e Adding copyright headers and explaining why these unused imports are here 2011-05-18 08:37:48 -05:00
Elrond
254bc43174 Move ObjectId, DESCENDING to db.util
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.
2011-05-18 11:32:29 +02:00
Elrond
a4bae8700e Move "connect to database" into db/util.py 2011-05-18 01:03:40 +02:00
Elrond
0f18ed8f5e Move models into new db/ directory
The database is a central point of interest/discussion.
Represent that by its own directory.

This will surely become more interesting when we have
migrations for example.
2011-05-18 00:44:10 +02:00