Business object - abuzarhamza/PostAScholarship GitHub Wiki

POSTASCHOLARSHIP

table user_profile

user_id ,

user_name ,

display_name,

first_name,

last_name ,

type (moderator|admin),

about_me,

web ,

gold_badge ,

silver_badge,

bronze_badge,

new_message ,

last_visited,

score,

rank ,

about_me_html ,

location,

status (suspended|active),

email_varified,

my_tags

table notes

note_sender_id(foreign key) ,

note_target_id (foreign key) ,

content (varchar5000) ,

html (varchar5000) ,

date ,

unread (bool) ,

type(NOTE_TYPES)

table tags

tag_id(primary_key)

tag_name(char60)

tag_description(varchar250)

tag_count(int)

table tag_alias

alias_id(primary_key)

alias_name

tag_id (foreign key)

tag_post_rel

rel_id(primary_key)

tag_id(foreign key)

post_id(foreign key)

date

post_view

Keeps track of post views based on IP base. If same ip within one hour no raise in count sn_no

ip (index)

post_id (foreign_key)

dateTime

table vote

author_id (foreign_key),

post_id (foreign_key) ,

type(VOTE_UP|VOTE_DOWN|VOTE_ACCEPT|VOTE_BOOKMARK|VOTE_FLAG) ,

datetime

table badge

name(varchar50)

description (varchar200)

type(BADGE_TYPES) ,

unique(bool false) Unique badges may be earned only once

secret(bool false) Secret badges are not listed on the badge list

count(int) Total number of times awarded

table related_posts

suggestion for user for similar post

source_id (foreign_key)

target_id (foreign_key)

table post_revision

Represents various revisions of a single post

post_id(foreign_key) ,

diff (text) ,

content (text) ,

author_id(foreign_key) ,

datetime

table post

author_id(foreignkey) ,

content (TextField NOT NULL 10000) the underlying Markdown

html(TextField NULL) this is the sanitized HTML for display

title(varchar200)

slug(varchar200)

views(int)

score(int)

full_score(int)

creation_date (dateTime)

lastedit_date (dateTime)

lastedit_user_id (foreign_key)

changed (bool) keeps track of which posts have changed

status (POST_OPEN, POST_CLOSE,POST_DELETED)

type(varchar,POST_TYPES) the type of the post for TYPE POST_QUESTION only answer are allowed FOR TYPE POST_BLOG posting COMMENTS FOR TYPE POST_USEFUL LINK thanks Count

contextTextField(max_length=1000)used to display a context the post was created/edited

this will maintain the ancestor/descendant relationship between posts

root = models.ForeignKey('self', related_name="descendants", null=True, blank=True)

this will maintain parent-child replationships between posts

parent = models.ForeignKey('self', null=True, blank=True, related_name='children')

the number of answer that a post has

answer_count = models.IntegerField(default=0, blank=True)

bookmark count

book_count = models.IntegerField(default=0, blank=True)

stickiness of the post

sticky = models.IntegerField(default=0, db_index=True)

weather the post has accepted answers

accepted = models.BooleanField(default=False, blank=True)

used for post with a linkout

url = models.URLField(default='', blank=True)

relevance measure, initially by timestamp, other rankings measures

rank = models.FloatField(default=0, blank=True)

flag_count(int) (if count if greater than 5 than it is closed)

table flag_post

post_id ,

flagger_id ,

moderator_id ,

context

approved