Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78624725
webalert_model.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Aug 22, 01:26
Size
2 KB
Mime Type
text/x-python
Expires
Sat, Aug 24, 01:26 (2 d)
Engine
blob
Format
Raw Data
Handle
20077716
Attached To
R3600 invenio-infoscience
webalert_model.py
View Options
# -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02D111-1307, USA.
"""
webalert database models.
"""
# General imports.
from
invenio.sqlalchemyutils
import
db
# Create your models here.
from
invenio.websession_model
import
User
from
invenio.webbasket_model
import
BskBASKET
from
invenio.websearch_model
import
WebQuery
class
UserQueryBasket
(
db
.
Model
):
"""Represents a UserQueryBasket record."""
__tablename__
=
'user_query_basket'
id_user
=
db
.
Column
(
db
.
Integer
(
15
,
unsigned
=
True
),
db
.
ForeignKey
(
User
.
id
),
nullable
=
False
,
server_default
=
'0'
,
primary_key
=
True
)
id_query
=
db
.
Column
(
db
.
Integer
(
15
,
unsigned
=
True
),
db
.
ForeignKey
(
WebQuery
.
id
),
nullable
=
False
,
server_default
=
'0'
,
primary_key
=
True
,
index
=
True
)
id_basket
=
db
.
Column
(
db
.
Integer
(
15
,
unsigned
=
True
),
db
.
ForeignKey
(
BskBASKET
.
id
),
nullable
=
False
,
server_default
=
'0'
,
primary_key
=
True
,
index
=
True
)
frequency
=
db
.
Column
(
db
.
String
(
5
),
nullable
=
False
,
server_default
=
''
,
primary_key
=
True
)
date_creation
=
db
.
Column
(
db
.
Date
,
nullable
=
True
)
date_lastrun
=
db
.
Column
(
db
.
Date
,
nullable
=
True
,
server_default
=
'0001-01-01'
)
alert_name
=
db
.
Column
(
db
.
String
(
30
),
nullable
=
False
,
server_default
=
''
,
index
=
True
)
alert_desc
=
db
.
Column
(
db
.
Text
)
alert_recipient
=
db
.
Column
(
db
.
Text
)
notification
=
db
.
Column
(
db
.
Char
(
1
),
nullable
=
False
,
server_default
=
'y'
)
user
=
db
.
relationship
(
User
,
backref
=
'query_baskets'
)
webquery
=
db
.
relationship
(
WebQuery
,
backref
=
'user_baskets'
)
basket
=
db
.
relationship
(
BskBASKET
,
backref
=
'user_queries'
)
__all__
=
[
'UserQueryBasket'
]
Event Timeline
Log In to Comment