nattilypf: (Default)
[personal profile] nattilypf
Hi everyone!

I always knew I was too unreliable for consistent blogging :/ To be honest, I just got started coding and was too into writing the code to talk about writing the code. I'll try to do a really good job of catching you up to wear I'm at now, to make up for it.

So basically, in my last post, I gave you all my comprehensive plan for implementation, and once I had created that, I felt totally ready to begin coding, so I started the actual hacking phase a little earlier than the 17th.

At this point: I believe I have done all of the work on changing the database that I need to do.

I've added in these classes to mediagoblin.db.models:

  • ReportBase

    • CommentReport

    • MediaReport

  • Group

  • UserBan



The Report classes are to be used whenever a user reports either a comment or a media entry. They hold information about the situation such as the offending entry's ID, the reason why it was reported, the reporting user's ID, etc.

The UserBan class is a simple one, it acts as like a marker to see if a user is currently banned. It exists in a one-to-one relationship with the User class, and if a User has a UserBan in relationship with them, they (the User) are currently banned. The UserBan table also has a column to hold the reason why the User was banned (to be displayed to the User if they try to log in) and a column that holds when the ban expires.

The Group class is in a many-to-many relationship with User. This one was a huge struggle for me to figure out how to fit with migrations, but at the end of a long night I got it \o/. That said.... I am currently using an association table that looks like this:
association_table = Table('core__group_user_associations', Base.metadata,
Column('core__group_id', Integer, ForeignKey(User.id)),
Column('core__user_id', Integer, ForeignKey(Group.id))
)

As you may have noticed... I did not refactor this into a class, so it 'core__group_user_associations' won't be instantiated when someone makes a new GMG instance. I will work on fixing this today *going back to the drawing board*

And, aside from all this work on models (obviously the *foundation* work), I've been making the skeleton pages of new admin pages. I've now set up an admin page to view/search for Users, and the view/search for Reports, but they both need a lot of work.

I've been visitting my family this week, so I will admit that in all the bustle of packing, this project got deprioritized, but now I've settled back it and am prepared and able to set aside the necessary hours~ I'll let you know how the home stretch of foundational models work goes!

tillyQ

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 Aug. 24th, 2017 06:46 am
Powered by Dreamwidth Studios