These are chat archives for andela/andela-21-lite

2nd
Apr 2016
Stanley Ndagi
@NdagiStanley
Apr 02 2016 07:45
Cool
Catherine Rakama
@crakama
Apr 02 2016 07:46
This message was deleted
Using format to output student details print "RegNo: {} \nStudentName:{} {}" .format(self.student_id, self.fname, self.lname)
Stanley Ndagi
@NdagiStanley
Apr 02 2016 07:50
@crakama It's even better to have:
Using format to output student details ```print "RegNo: {0} \nStudentName:{1} {2}" .format(self.student_id, self.fname, self.lname)
print "RegNo: {0} \nStudentName:{2} {1}" .format(self.student_id, self.lname, self.fname)
Because you can order them
Walusimbi Mahad
@andela-engmkwalusimbi
Apr 02 2016 08:51
https://github.com/davidmarble/virtualenvwrapper-win
Please follow the link and install Virtualenvwrapper for guys using windows.
And guys using Linux boxes follow this link: http://docs.python-guide.org/en/latest/dev/virtualenvs/
Eric G
@egichuri
Apr 02 2016 09:44
models.py
from sqlalchemy import create_engine, ForeignKey
from sqlalchemy import Column, Date, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref

engine = create_engine('sqlite:///school.db', echo=True)
Base = declarative_base()


class Student(Base):
    pass


class Faculty(Base):
    pass


class Course(Base):
    pass


class Unit(Base):
    pass


Base.metadata.create_all(engine)
app.py
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import Student, Faculty, Course, Unit

engine = create_engine('sqlite:///school.db', echo=True)

# create a Session
Session = sessionmaker(bind=engine)
session = Session()
Lewis Kabui
@andela-lkabui
Apr 02 2016 09:58
first_name = Column(String)
Lewis Kabui
@andela-lkabui
Apr 02 2016 10:04
admission_no = Column(String, primary_key=True)
Lewis Kabui
@andela-lkabui
Apr 02 2016 10:10
__tablename__ = "student"
if __name__ == '__main__':
    Base.metadata.create_all(engine)
Stanley Ndagi
@NdagiStanley
Apr 02 2016 10:16
This message was deleted
Eric G
@egichuri
Apr 02 2016 11:28
For Django the Django Girls tutorial is a nice one.
http://tutorial.djangogirls.org/en/
You can also share good tutorials you come across, or any other materials
And a piece of advice: Try and stick to one tutorial when starting. Otherwise the different concepts used in different tutorials might be confusing. After you’re done with one you can move on to another.
Nzisa
@fnzisa
Apr 02 2016 11:49
@andela-egichuri Thank you.
Margaret Ochieng
@margierain
Apr 02 2016 17:35
missed a great session.. wish they was a youtube video