Remove BlogPost model and Add attribute for blog id in BlogPostData.
authorAditi <aditi.iitr@gmail.com>
Sat, 20 Jul 2013 05:58:10 +0000 (11:28 +0530)
committerAditi <aditi.iitr@gmail.com>
Sat, 20 Jul 2013 05:58:10 +0000 (11:28 +0530)
mediagoblin/media_types/blog/models.py

index f7e907a5d0daa44e17c10e6c01dc9f547961d0d6..a641861bc2abad31a3a089f3307f9f3a369294d7 100644 (file)
@@ -41,19 +41,16 @@ class Blog(Base, BlogMixin):
     author = Column(Integer, ForeignKey(User.id), nullable=False, index=True) #similar to uploader
     created = Column(DateTime, nullable=False, default=datetime.datetime.now, index=True)
     slug = Column(Unicode)
-    
-#class BlogPost(MediaEntry):
-    #__tablename__ = "mediatype__blog_blogposts"
-    #blog = Column(Integer, ForeignKey(Blog.id), nullable=False)
+
     
 BACKREF_NAME = "blogpost__media_data"
 
-
 class BlogpostData(Base):
     __tablename__ = "blogpost__mediadata"
 
     # The primary key *and* reference to the main media_entry
     media_entry = Column(Integer, ForeignKey('core__media_entries.id'), primary_key=True)
+    #blog = Column(Integer, ForeignKey('mediatype__blogs.id', nullable=False)
     get_media_entry = relationship("MediaEntry",
         backref=backref(BACKREF_NAME, uselist=False,
                         cascade="all, delete-orphan"))