Added support for http callbacks on processing
Sends an HTTP POST request back to an URL given on submission to the API submit view.
This commit is contained in:
@@ -20,7 +20,8 @@ from sqlalchemy import (MetaData, Table, Column, Boolean, SmallInteger,
|
||||
Integer, Unicode, UnicodeText, DateTime, ForeignKey)
|
||||
|
||||
from mediagoblin.db.sql.util import RegisterMigration
|
||||
from mediagoblin.db.sql.models import MediaEntry, Collection, User
|
||||
from mediagoblin.db.sql.models import MediaEntry, Collection, User, \
|
||||
ProcessingMetaData
|
||||
|
||||
MIGRATIONS = {}
|
||||
|
||||
@@ -101,3 +102,9 @@ def add_mediaentry_collected(db_conn):
|
||||
col = Column('collected', Integer, default=0)
|
||||
col.create(media_entry)
|
||||
db_conn.commit()
|
||||
|
||||
|
||||
@RegisterMigration(6, MIGRATIONS)
|
||||
def create_processing_metadata_table(db):
|
||||
ProcessingMetaData.__table__.create(db.bind)
|
||||
db.commit()
|
||||
|
||||
@@ -412,9 +412,24 @@ class CollectionItem(Base, CollectionItemMixin):
|
||||
return DictReadAttrProxy(self)
|
||||
|
||||
|
||||
class ProcessingMetaData(Base):
|
||||
__tablename__ = 'core__processing_metadata'
|
||||
|
||||
id = Column(Integer, primary_key=True)
|
||||
media_entry_id = Column(Integer, ForeignKey(MediaEntry.id), nullable=False,
|
||||
index=True)
|
||||
media_entry = relationship(MediaEntry, backref='processing_metadata')
|
||||
callback_url = Column(Unicode)
|
||||
|
||||
@property
|
||||
def dict_view(self):
|
||||
"""A dict like view on this object"""
|
||||
return DictReadAttrProxy(self)
|
||||
|
||||
|
||||
MODELS = [
|
||||
User, MediaEntry, Tag, MediaTag, MediaComment, Collection, CollectionItem, MediaFile, FileKeynames,
|
||||
MediaAttachmentFile]
|
||||
MediaAttachmentFile, ProcessingMetaData]
|
||||
|
||||
|
||||
######################################################
|
||||
|
||||
Reference in New Issue
Block a user