projects
/
zzz-floof.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ea3d7fc
)
Tiny fixes: save a query for by:me, and count() is a method.
author
Eevee
<git@veekun.com>
Mon, 7 Dec 2009 04:35:44 +0000
(20:35 -0800)
committer
Eevee
<git@veekun.com>
Mon, 7 Dec 2009 04:35:44 +0000
(20:35 -0800)
floof/lib/tags.py
patch
|
blob
|
history
floof/websetup.py
patch
|
blob
|
history
diff --git
a/floof/lib/tags.py
b/floof/lib/tags.py
index
e75629e
..
134ba6f
100644
(file)
--- a/
floof/lib/tags.py
+++ b/
floof/lib/tags.py
@@
-90,9
+90,6
@@
def add_tags(art, tag_string, user):
if prefix == 'by':
# XXX this needs supporting. silently ignore for now
continue
if prefix == 'by':
# XXX this needs supporting. silently ignore for now
continue
-
- if tag_text == 'me':
- tag_text = c.user.name
# Must be 3-50 alphanumeric characters
if not re.match('^[a-z0-9]{3,50}$', tag_text):
# Must be 3-50 alphanumeric characters
if not re.match('^[a-z0-9]{3,50}$', tag_text):
@@
-101,7
+98,10
@@
def add_tags(art, tag_string, user):
# Do work!
if prefix:
# Do work!
if prefix:
- target_user = User.get_by(name=tag_text)
+ if tag_text == 'me':
+ target_user = c.user
+ else:
+ target_user = User.get_by(name=tag_text)
# Special tag; at the moment, just a relationship
if prefix == 'by':
# Special tag; at the moment, just a relationship
if prefix == 'by':
diff --git
a/floof/websetup.py
b/floof/websetup.py
index
be104da
..
06c0e9c
100644
(file)
--- a/
floof/websetup.py
+++ b/
floof/websetup.py
@@
-22,14
+22,10
@@
def setup_app(command, conf, vars):
### Sample data
# Users
from floof.model.users import IdentityURL, User
### Sample data
# Users
from floof.model.users import IdentityURL, User
- if not User.query.filter_by(name=u'eevee').count:
+ if not User.query.filter_by(name=u'eevee').count
()
:
identity_url = IdentityURL(url=u'http://eevee.livejournal.com/')
user = User(name=u'eevee')
user.identity_urls.append(identity_url)
identity_url = IdentityURL(url=u'http://eevee.livejournal.com/')
user = User(name=u'eevee')
user.identity_urls.append(identity_url)
-
- ### Make the canonical user-page
- from floof.model import UserPage
- UserPage.make_primary_template()
model.Session.commit()
model.Session.commit()