Friday, November 28, 2014

Tuesday, November 25, 2014

NULL values excluded from NOT IN - SQLAlchemy+SQLite

Solution: AND column IS NOT NULL

Example: query.filter(or_(~self.column.in_(value), self.column == None))

This thread explains "SQL Server in treating NULL as a value": http://stackoverflow.com/questions/11491831/null-values-are-excluded-why

Github Asking For Password After Adding SSH Key

Run: git remote -v

If the output has a URL that starts with https://github.com and not git@github.com, you need to change that by running a command similar to this: git remote set-url origin git@github.com:pawl/flask-admin.git

Friday, November 21, 2014

Guide To Syncing Fork With Original Project

https://help.github.com/articles/syncing-a-fork/

From my fork, I ran these commands:

  1. git remote add upstream https://github.com/mrjoes/flask-admin.git
  2. git fetch upstream
  3. git merge upstream/master
  4. git push
Create new branch and sync with upstream (change the bolded text):
  1. git remote add upstream https://github.com/mrjoes/flask-admin.git
  2. git fetch upstream
  3. git checkout -b issue_xxxx upstream/master

Sunday, November 16, 2014

Configuring Notepad++ For Python

On the Settings->"Preferences", "Tab Settings" tab, I set "[Default]" at Tab size: 8, uncheck Replace by space; and set "Python" to uncheck Use default value, Tab size: 4, check Replace by space. This causes inserts into a python source to use 4 spaces for indents, and indent with spaces instead of tabs. 
If I end up with any tabs in the source, I use Edit->Blank Operations->TAB to Space to convert them. I also clean up trailing blanks with Edit->Blank Operations->Trim Trailing Space. 
I install and use the pep8 package to verify standard formatting.
http://www.reddit.com/r/Python/comments/2mfrn6/python_in_notepad/cm3tdj5

Monday, November 10, 2014

Using Bootstrap-DateRangePicker As A Timepicker

Here's the jsfiddle: http://jsfiddle.net/d8uomdjv/

It seems like the author is opposed to adding this sort of functionality: https://github.com/dangrossman/bootstrap-daterangepicker/issues/295

re.match vs re.search - Python

http://stackoverflow.com/a/180993/1364191

  • re.match - If zero or more characters at the beginning of string match the regular expression pattern.
  • re.search - Scan through string looking for a location where the regular expression pattern produces a match


Saturday, November 8, 2014

New Machine Setup For Flask Development On Ubuntu

Here are the commands I use when I bring up a new Ubuntu server for flask development: