This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello World! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
File "/home/hari/venv/lib/python3.3/site-packages/pyramid_debugtoolbar-1.0.8-py3.3.egg/pyramid_debugtoolbar/panels/performance.py", line 55, in resource_timer_handler | |
result = handler(request) | |
File "/home/hari/venv/lib/python3.3/site-packages/pyramid_debugtoolbar-1.0.8-py3.3.egg/pyramid_debugtoolbar/panels/performance.py", line 85, in profile_handler | |
result = self.profiler.runcall(handler, request) | |
File "/usr/lib/python3.3/cProfile.py", line 144, in runcall | |
return func(*args, **kw) | |
File "/home/hari/venv/lib/python3.3/site-packages/pyramid-1.5a2-py3.3.egg/pyramid/tweens.py", line 21, in excview_tween | |
response = handler(request) | |
File "/home/hari/venv/lib/python3.3/site-packages/pyramid_tm-0.7-py3.3.egg/pyramid_tm/__init__.py", line 82, in tm_tween |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlalchemy.exc.InternalError: (InternalError) (1293, 'Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause') '\nCREATE TABLE user (\n\tactivation_id INTEGER, \n\tregistered_date TIMESTAMP DEFAULT now(), \n\temail VARCHAR(100) NOT NULL, \n\tsecurity_code VARCHAR(256), \n\tpassword VARCHAR(256) NOT NULL, \n\tstatus INTEGER, \n\tusername VARCHAR(30) NOT NULL, \n\tlast_login_date TIMESTAMP DEFAULT now(), \n\tsalt VARCHAR(256) NOT NULL, \n\tid INTEGER NOT NULL AUTO_INCREMENT, \n\tPRIMARY KEY (id), \n\tFOREIGN KEY(activation_id) REFERENCES activation (id), \n\tUNIQUE (email), \n\tUNIQUE (security_code), \n\tUNIQUE (username)\n)CHARSET=utf8 ENGINE=InnoDB\n\n' () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#my user model | |
from datatime import datetime | |
class User(UserMixin, Base): | |
last_login_date = Column(DateTime,nullable=False) | |
registered_date = Column(DateTime, default=datetime.utcnow,nullable=False) | |
#traceback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to load the tinymce using retail rendering i tried adding script in the head for tinymce but tinymce is not showing up | |
#Schema is as below | |
class Person(colander.Schema): | |
name = colander.SchemaNode( | |
colander.String(), | |
widget=deform.widget.RichTextWidget(delayed_load=True),) | |
shoe_size = colander.SchemaNode( | |
colander.Integer(), | |
missing = 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
users_tags_table = Table('users_tags', Base.metadata, | |
Column('users_id', Integer, ForeignKey('users.id')), | |
Column('tags_id', Integer, ForeignKey('tags.id')) | |
) | |
users_tags_table = Table('users_groups', Base.metadata, | |
Column('users_id', Integer, ForeignKey('users.id')), | |
Column('groups_id', Integer, ForeignKey('groups.id')) | |
) | |
class Users(Base): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Installation : easy_install alembic or pip install alembic | |
Changing the dialect of database in alembic.ini to your own local database | |
In alembic folder change the env.py folder's settings as | |
from myapp.models import Base | |
target_metadata = Base.metadata | |
Now run command : alembic upgrade head |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html ng-app="project" ng-init="users=["mahesh", "hari"];;"> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular-resource.min.js"> | |
</script> | |
</head> | |
<body> | |
<div > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
def check_in_range(a): | |
if a>=0 and a<5: | |
return True | |
else: | |
return False | |
def find_matrix(blocker): | |
a = [[1,0,1,1,1],[1,0,0,0,1],[1,0,0,0,1],[1,0,0,0,1],[1,1,1,0,1]] | |
if not blocker: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Views | |
import logging | |
logger = logging.getLogger(__name__) | |
# Settings | |
LOGGING = { | |
'version': 1, |
OlderNewer