arxiv.users.legacy.models module

ORM models for legacy user and session tables.

class arxiv.users.legacy.models.DBCategory(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Metadata about arXiv categories.

Field Type Null Key Default
archive subject_class definitive active category_name endorse_all endorse_email papers_to_endorse endorsement_domain varchar(16) varchar(16) int(1) int(1) varchar(255) enum(‘y’,’n’,’d’) enum(‘y’,’n’,’d’) smallint(5) unsigned varchar(32) NO NO NO NO YES NO NO NO YES

PRI PRI

MUL

0 0 NULL d d 0 NULL
active
archive
definitive
endorsement_domain
subject_class
class arxiv.users.legacy.models.DBDocumentInCategory(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

M2M intermediate table for documents and their categories.

Field Type Null Key Default Extra
document_id archive subject_class is_primary mediumint(8) unsigned varchar(16) varchar(16) tinyint(1) NO NO NO NO PRI PRI PRI

0

0

 
archive
document_id
is_primary
subject_class
class arxiv.users.legacy.models.DBDocuments(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Represents an arXiv paper.

Field Type Null Key Default
document_id paper_id title authors submitter_email submitter_id dated primary_subject_class created mediumint(8) unsigned varchar(20) varchar(255) text varchar(64) int(10) unsigned int(10) unsigned varchar(16) datetime NO NO NO YES NO YES NO YES YES

PRI UNI MUL

MUL MUL MUL

NULL

NULL

NULL 0 NULL NULL

dated
document_id
paper_id
class arxiv.users.legacy.models.DBEmailBlacklist(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Patterns for identifying non-academic addresses.

pattern | varchar(64) | YES | | NULL |

pattern
class arxiv.users.legacy.models.DBEmailWhitelist(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Patterns for identifying academic addresses.

pattern | varchar(64) | YES | | NULL |

pattern
class arxiv.users.legacy.models.DBEndorsement(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Category endorsements for arXiv users.

Field Type Null Key Default
endorsement_id endorser_id endorsee_id archive subject_class flag_valid type point_value issued_when request_id int(10) unsigned int(10) unsigned int(10) unsigned varchar(16) varchar(16) int(1) unsigned enum(‘user’,’admin’,’auto’) int(1) unsigned int(10) unsigned int(10) unsigned NO YES NO NO NO NO YES NO NO YES

PRI MUL MUL MUL

MUL

NULL NULL 0

0 NULL 0 0 NULL

archive
endorsee
endorsee_id
endorsement_id
endorsement_type
endorser_id
flag_valid
issued_when
point_value
request_id
subject_class
class arxiv.users.legacy.models.DBEndorsementDomain(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Encodes some policies about endorsement.

Field Type Null Key Default
endorsement_domain endorse_all mods_endorse_all endorse_email papers_to_endorse varchar(32) enum(‘y’,’n’) enum(‘y’,’n’) enum(‘y’,’n’) smallint(5) unsigned NO NO NO NO NO PRI n n y 4
endorse_all
endorse_email
endorsement_domain
mods_endorse_all
papers_to_endorse
class arxiv.users.legacy.models.DBPaperOwners(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Relates arXiv users to their owned papers.

Field Type Null Key Default Extra
document_id user_id date valid flag_author mediumint(8) unsigned int(10) unsigned int(10) unsigned int(1) unsigned int(1) unsigned NO NO NO NO NO PRI PRI 0 0 0 0 0  
date
document_id
flag_author
user_id
valid
class arxiv.users.legacy.models.DBPermanentToken(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Bearer token for user authentication.

Field Type Null Key Default Extra
user_id secret valid issued_when issued_to remote_host session_id int(4) unsigned varchar(32) int(1) int(4) unsigned varchar(16) varchar(255) int(4) unsigned NO NO NO NO NO NO NO

PRI PRI

MUL

0

1 0

0

 
issued_to

IP address of client.

issued_when

Epoch time.

remote_host
secret

Token.

session_id
user_id
valid
class arxiv.users.legacy.models.DBPolicyClass(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Legacy authorization table.

ADMIN = 1
LEGACY_USER = 3
POLICY_CLASSES = [{'name': 'Administrator', 'class_id': 1, 'description': ''}, {'name': 'Public user', 'class_id': 2, 'description': ''}, {'name': 'Legacy user', 'class_id': 3, 'description': ''}]
PUBLIC_USER = 2
class_id
description
name
password_storage
permanent_login
recovery_policy
class arxiv.users.legacy.models.DBProfile(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Legacy user profiles.

GROUP_FLAGS = [('grp_physics', 'flag_group_physics'), ('grp_math', 'flag_group_math'), ('grp_cs', 'flag_group_cs'), ('grp_q-bio', 'flag_group_q_bio'), ('grp_q-fin', 'flag_group_q_fin'), ('grp_q-stat', 'flag_group_stat'), ('grp_q-econ', 'flag_group_econ'), ('grp_eess', 'flag_group_eess')]
TYPE_CHOICES = [(1, 'Staff'), (2, 'Professor'), (3, 'Post Doc'), (4, 'Grad Student'), (5, 'Other')]

Legacy ranks in arXiv user profiles.

affiliation
archive
country
flag_group_cs
flag_group_econ
flag_group_eess
flag_group_math
flag_group_nlin
flag_group_physics
flag_group_q_bio
flag_group_q_fin
flag_group_stat
groups

Active groups for this user profile.

Return type:List[str]
original_subject_classes
rank
subject_class
to_domain()[source]

Generate a domain representation from this database instance.

Return type:UserProfile
url
user
user_id
class arxiv.users.legacy.models.DBSession(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Legacy arXiv session table.

Field Type Null Key Default
session_id | int(4) unsigned user_id | int(4) unsigned last_reissue | int(11) start_time | int(11) end_time | int(11) NO NO NO NO NO

PRI MUL

MUL MUL

NULL 0 0 0 0
end_time
last_reissue
session_id
start_time
user
user_id
class arxiv.users.legacy.models.DBSessionsAudit(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Legacy arXiv session audit table. Notably has a tracking cookie.

ip_addr
remote_host
session
session_id
class arxiv.users.legacy.models.DBUser(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Legacy user data table.

email
email_bouncing
first_name
flag_allow_tex_produced
flag_approved
flag_banned
flag_deleted
flag_edit_system
flag_edit_users
flag_email_verified
flag_html_email
flag_internal
flag_wants_email
joined_date
joined_ip_num
joined_remote_host
last_name
policy_class
share_email
share_first_name
share_last_name
suffix_name
user_id
class arxiv.users.legacy.models.DBUserNickname(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Users’ usernames (because why not have a separate table).

Field Type Null Key Default Extra
nick_id nickname user_id user_seq flag_valid role policy flag_primary int(10) unsigned varchar(20) int(4) unsigned int(1) unsigned int(1) unsigned int(10) unsigned int(10) unsigned int(1) unsigned NO NO NO NO NO NO NO NO

PRI UNI MUL

MUL MUL MUL

NULL

0 0 0 0 0 0

autoincrement
flag_primary
flag_valid
nick_id
nickname
policy
role
user
user_id
user_seq
class arxiv.users.legacy.models.DBUserPassword(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Legacy password table.

password_enc
password_storage
user
user_id