nattilypf: (Default)
[personal profile] nattilypf
This just in: I LOVE organization

Implementation

  • Working with models
    • Create new Report Model
      • coderoute: mediagoblin.db.models.Report

        id = Column(Integer, primary_key=True)
        reporter_id = Column(Integer, ForeignKey('user.id')) #NOT SURE THIS IS CORRECT
        reporter =  Relationship(User, backref="reports_filed_by")
        offender_id = Column(Integer, ForeignKey('user.id')) #NOT SURE THIS IS CORRECT
        offender =  Relationship(User, backref="reports_filed_on")



        Subclass: MediaReport Model

        • coderoute: mediagoblin.db.models.MediaReport

          media_id = Column(Integer, ForeignKey('core_media_entries.id')) #NOT SURE THIS IS CORRECT
          media =  Relationship(MediaEntry, backref="reports_filed_on")

        Subclass: CommentReport Model

        • coderoute: mediagoblin.db.models.CommentReport

          media_id = Column(Integer, ForeignKey('core_media_comments.id')) #NOT SURE THIS IS CORRECT
          media =  Relationship(MediaComment, backref="reports_filed_on")

    • Create new Group Model
      • coderoute: mediagoblin.db.models.Group
      • Fields
        • id = Column(Integer, primary_key=True)
        • name = Column(Unicode, nullable=False, unique=True)
      • Initialize Default Groups
        • Default Groups
          • admin
          • moderator
          • active
            • is their email activated?
          • media-poster
          • commenter
          • banned
        • How-To?
    • Modify User Model
      • Add in a Many-to-Many Relationship Between User and Group
        • coderoute: mediagoblin.db.models.User

          docs: http://docs.sqlalchemy.org/en/rel_0_7/orm/relationships.html?highlight=many%20many

          advice: http://issues.mediagoblin.org/ticket/678

          groups = Relationship(Group,
          secondary=association_table,
          backref=backref("all_users",
              lazy="dynamic",
              cascade="all, delete-orphan"
          )     
          )





    • Create Association Table btwn User & Group
      • coderoute: mediagoblin.db.models
    • Migrations
      • coderoute: mediagoblin.db.migrations

        Task: Migrate old Users into User model w/ new Group relationship field and Group Id Field

        @RegisterMigration(11, MIGRATIONS)
        def add_group_id_column(db_conn):
            metadata = MetaData(bind=db_conn.bind)

             users = Table('core__users', metadata, autoload=True,
                   autoload_with=db_conn.bind)

             col =  XXXXXXXXXXXXXXXXFILL THIS INXXXXXXXXXXXXX
            col.create(users, populate_defaults=True)

            db_conn.commit()









  • Working with web pages
    • Modify Old Pages
      • Admin Pages {/a/}
        • Media Processing Panel
          • Task: Rename the functions and urlroutes away from the general word 'panel'
          • routing
            • coderoute: mediagoblin.admin.routing

              REPLACE

                  ('mediagoblin.admin.panel',

                      '/panel',

                      'mediagoblin.admin.views:admin_processing_panel'),

              WITH

                  ('mediagoblin.admin.media_processsing',

                      '/media',

                      'mediagoblin.admin.views:admin_media_processing_panel'),

          • views
            • coderoute: mediagoblin.admin.views

              REPLACE

                  def admin_processing_panel:

              WITH

                  def admin_media_processing_panel:

              REPLACE

                  return render_to_response(

                      request,

                      'mediagoblin/admin/panel.html',

              WITH

                  return render_to_response(

                      request,

                      'mediagoblin/admin/media_panel.html',

          • template
            • coderoute: templates.mediagoblin.admin.panel.html
            • $ mv panel.html media_pane.html
      • User Pages {/u/}
        • Media Home Page
          • coderoute: templates.mediagoblin.user_pages.media.html
          • Add in a report button for all users
            • coderoute: templates.mediagoblin.user_pages.media.html
          • Add in moderator/admin only visible actions
            • coderoute: templates.mediagoblin.user_pages.media.html
        • User Home Page
          • coderoute: templates.mediagoblin.user_pages.user.html
          • Add in a report button for all users
            • coderoute: templates.mediagoblin.user_pages.user.html
          • Add in moderator/admin only visible actions
            • coderoute: templates.mediagoblin.user_pages.user.html
    • Add new Pages
      • Admin Pages {/a/}
        • coderoute: mediagoblin.admin
        • templateroute: mediagoblin.admin
        • User Management Panel
          • routing.py
            • coderoute: mediagoblin.admin.routing
            •    ('mediagoblin.admin.users',
              '/users',
              'mediagoblin.admin.views:admin_users_panel')

          • views.py
            • coderoute: mediagoblin.admin.views:admin_users_panel
          • template
        • Reports Processing Panel
          • routing.py
            • coderoute: mediagoblin.admin.routing
            •    ('mediagoblin.admin.reports',
              '/reports',
              'mediagoblin.admin.views:admin_reports_panel')

          • views.py
            • coderoute: mediagoblin.admin.views:admin_reports_panel
          • template
        • Groups Panel
          • routing.py
            • coderoute: mediagoblin.admin.routing
            •    ('mediagoblin.admin.groups',
              '/groups',
              'mediagoblin.admin.views:admin_groups_panel')

          • views.py
            • coderoute: mediagoblin.admin.views:admin_groups_panel
          • template
        • Editting the Code of Conduct
          • routing.py
            • coderoute: mediagoblin.admin.routing

                 ('mediagoblin.admin.code_of_conduct',
              '/code-of-conduct',
              'mediagoblin.admin.views:admin_code_of_conduct_panel')

          • views.py
            • coderoute: mediagoblin.admin.views:admin_code_of_conduct_panel
          • template
      • Moderator Pages
        • coderoute: mediagoblin.moderator

          templateroute: mediagoblin.moderator

          $ mkdir mediagoblin/moderator \

              mediagoblin/templates/mediagoblin/moderator

          User Management Panel

          • routing.py
            • coderoute: mediagoblin.moderator.routing

                 ('mediagoblin.moderator.users',
              '/users',
              'mediagoblin.moderator.views:moderator_users_panel')

          • views.py
            • coderoute: mediagoblin.moderator.views:moderator_users_panel
          • template

          Reports Processing Panel

          • routing.py
            • coderoute: mediagoblin.moderator.routing

                 ('mediagoblin.moderator.reports',
              '/reports',
              'mediagoblin.moderator.views:moderator_reports_panel')

          • views.py
            • coderoute: mediagoblin.moderator.views:moderator_reports_panel
          • template

      • Everyone Pages
        • Code of Conduct
          • routing.py
            • coderoute: mediagoblin.routing
          • views.py
          • template
        • Reports Observation Page
          • routing.py
            • coderoute: mediagoblin.routing
          • views.py
          • template
        • Website Punishment History page
          • routing.py
            • coderoute: mediagoblin.routing
          • views.py
          • template
        • Personal Punishment History Page
          • routing.py
            • coderoute: mediagoblin.user_pages.routing

              add_route('mediagoblin.user_pages.punishment_history',
              '/u/<string:user>/punishment-history',
              'mediagoblin.user_pages.views:user_punishment_history')

          • views.py
          • template
        • Report POST Request page
          • coderoute mediagoblin.???
          • Purpose: Creates a Report
          • routing.py
          • views.py
          • template
          • data
            • Offending comment_id/media_id
            • Offender user_id
            • Reporter user_id
            • Referring URL
      • Punished User Pages
        • Why are you banned? Page
      • <Process of Adding Pages>
        • Add new templates to Templates Foler
        • Add new entry to appropriate Routing.py
        • Add new entry to appropriate Views.py
    • Include New Pages
      • Add to mediagoblin.routing

        • from mediagoblin.moderator.routing import moderator_routes

          ...

              mount('mod', moderator_routes)

  • Working with other aspects
    • Create new Method to Check User's Group Status
      • coderoute: mediagbolin.tools.???
      • advice: http://issues.mediagoblin.org/ticket/678
    • Create new Form Objects
      • Create new ReportForm
        • coderoute: mediagoblin.user_pages.forms
      • GroupCreateForm
      • AttachUserToGroup

About Me

nattilypf: (Default)
Natalie Foust-Pilcher

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags

September 2013

S M T W T F S
1234567
891011121314
1516171819 2021
22232425262728
2930     

Project To-Do List

~A summary of what I'm currently working on and what I still have yet to do~
Page generated Jun. 27th, 2017 12:11 am
Powered by Dreamwidth Studios