Uh oh!
There was an error while loading. Please reload this page.
use sqlite as database - #126
Conversation
rishabhKalakoti
commented
May 19, 2019
Is this implementation okay? let's finalize for one table and then we will do it similarly for other tables |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
rishabhKalakoti
commented
May 19, 2019
So... I left contest and question database as work has to be done with that in #119 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
theSage21
commented
May 19, 2019
The indexing docs might be of help
What relations do you have in mind? I think linking between question,contest,submission,user should happen.
That's fine for now. Things will settle in a while. Let's get to a point where we can stop using |
Uh oh!
There was an error while loading. Please reload this page.
rishabhKalakoti
commented
May 20, 2019
Database fully implemented (almost).
|
theSage21
left a comment
There was a problem hiding this comment.
This is going in the right direction. 👍
Let's get the relations done
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-Authored-By: Arjoonn Sharma <theSage21@users.noreply.github.com>
I got some problems implementing relationships, can't really understand it. |
theSage21
commented
May 21, 2019
so foreign keys are a exactly what you mentioned. Simply numbers appearing in another table. But that is at the database level (mysql/sqlite). Right now we are using peewee which is an ORM. So in our case: classBase(pw.Model):
classMeta:
database=dbclassQuestion(Base):
instructions=pw.CharField()
classContest(Base):
title=pw.CharField()
classQuesInContest(Base):
question=pw.ForeignKeyField(Question)
contest=pw.ForeignKeyField(Contest)Peewee handles the index-integer-autoincrement thing for us. We just give it the class. Now to insert things into contest=Contest.create(...)
ques=Question.create(...)
q_in_c=QuesInContest.create(question=ques, contest=contest)
# or you could supply IDs ( for example when ID is a parameter in an API)qid=int(ques.id)
cid=int(contest.id)
q_in_c=QuesInContest.create(question=qid, contest=cid) |
theSage21
commented
May 21, 2019
I'd prefer to keep master in a working state always so if you could wrap up the relations thing also in this PR it would be wonderful! |
rishabhKalakoti
commented
May 21, 2019
I'll give it a shot :) |
rishabhKalakoti
commented
May 21, 2019
Should I implement the question table in this too? |
theSage21
commented
May 21, 2019
via email
It'll be nice if this was a full system 😊 …On Tue 21 May, 2019, 08:47 Rishabh Kalakoti, ***@***.***> wrote:
Should I implement the question table in this too?
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#126?email_source=notifications&email_token=AB2WHUMEBYZSNWITRGI5DATPWNSV7A5CNFSM4HN3X7N2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV2UGBQ#issuecomment-494224134>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB2WHUMZL3XM2LLLZSM6K5DPWNSV7ANCNFSM4HN3X7NQ>
.
|
rishabhKalakoti
commented
May 21, 2019
The database system looks ready to me now. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
theSage21
commented
May 21, 2019
This is starting to make sense! 👍 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
use sqlite as database (PyJaipur#126)
fixes#118
TODO