>>> sys.path.append('C:\\Python27\\Project\\App')
>>> sys.path.append('C:\\Python27\\lucia\\blog')
>>> import your_app
>>> import blog
>>> User.object.all()
>>> u = User(username='lady gaga', password='secret')
>>> u.save()
>>> p.id
>>> p.username
>>> p.password
You can update a value in a table just by:
>>> p.username = 'aura kasih'
>>> p.save()
To get the table as object, use:
>>> a = User.objects.all()
>>> for i in a:
print i.username, i.password
No comments:
Post a Comment