Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# -*- coding: utf-8 -*- """ Sample SQLAlchemy-powered model definition for the repoze.what SQL plugin. """ import os from hashlib import sha1 from datetime import datetime from sqlalchemy import Table, ForeignKey, Column from sqlalchemy.types import String, Unicode, UnicodeText, Integer, DateTime, \ Boolean, Float from sqlalchemy.orm import relation, backref, synonym from websitecore.model.meta import DeclarativeBase, metadata # This is the association table for the many-to-many relationship between # groups and permissions. group_permission_table = # This is the association table for the many-to-many relationship between # groups and members - this is, the memberships. user_group_table = # auth model """An ultra-simple group definition. """ __tablename__ = 'group' group_name = users = """Reasonably basic User definition. Probably would want additional attributes. """ __tablename__ = 'user' user_name = email = _password = """Hash password on the fly.""" hashed_password = password if : password_8bit = else: password_8bit = password salt = hash = hashed_password = + # make sure the hased password is an UTF-8 object at the end of the # process because SQLAlchemy _wants_ a unicode object for Unicode columns if not : hashed_password = self._password = hashed_password """Return the password for the current user""" return self._password password = """ Check the password against existing credentials. :param password: the password that was provided by the user to try and authenticate. This is the clear text version that we will need to match against the hashed one in the database. :type password: unicode object. :return: Whether the password is valid. :rtype: bool """ hashed_pass = return == """A relationship that determines what each Group can do""" __tablename__ = 'permission' permission_name = groups = |