Skip to content
This repository was archived by the owner on Sep 7, 2018. It is now read-only.

Commit 6435696

Browse files
committed
Added created_at field into langdev.user.User class.
Fixed a bug of `langdev.user.Password`. Readme typo.
1 parent 9f625b1 commit 6435696

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
LangDev_
2-
~~~~~~~~
1+
LangDev
2+
~~~~~~~
33

4-
**LangDev_** is a Korean community for programming language implementors and
4+
LangDev_ is a Korean community for programming language implementors and
55
designers. This software is a small web application for LangDev_. Its source
66
code is distributed under AGPL_.
77

langdev/user.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@
1515
import hashlib
1616
from sqlalchemy import *
1717
from sqlalchemy import orm
18+
from sqlalchemy.sql import functions
1819
import langdev.orm
1920

21+
__all__ = 'User', 'Password'
22+
2023

2124
class User(langdev.orm.Base):
2225
"""An user object."""
@@ -55,6 +58,10 @@ class User(langdev.orm.Base):
5558
#: His/her website.
5659
url = Column(UnicodeText)
5760

61+
#: Registered time in :class:`datetime.datetime`.
62+
created_at = Column(DateTime(timezone=True), nullable=False,
63+
default=functions.now())
64+
5865
@orm.validates(login)
5966
def validate_login(self, key, login):
6067
"""Validates the :attr:`login` name format.
@@ -136,8 +143,6 @@ class Password(object):
136143
#: Hash algorithm. MD5 is used.
137144
hash_algorithm = hashlib.md5
138145

139-
__slots__ = 'hash_string'
140-
141146
def __init__(self, hash_string):
142147
if isinstance(hash_string, unicode):
143148
hash_string = hash_string.encode(self.ENCODING)
@@ -153,7 +158,7 @@ def __eq__(self, password):
153158
password = password.encode(self.ENCODING)
154159
if not isinstance(password, str):
155160
return False
156-
return self.hash_algorithm(password).hexdigest == self.hash_string
161+
return self.hash_algorithm(password).hexdigest() == self.hash_string
157162

158163
def __ne__(self, password):
159164
return not (self == password)

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def find_packages(where='.'):
3131
author_email='minhee' '@' 'dahlia.kr',
3232
description='Programming language implementors and designers community.',
3333
packages=find_packages(),
34+
install_requires=['SQLAlchemy', 'Flask', 'Werkzeug'],
3435
include_package_data=True,
3536
zip_safe=False,
3637
license='AGPLv3')

0 commit comments

Comments
 (0)