How to Fix Raw query must include the primary key with Django ORM
When running raw SQL queries in Django you must include a primary key otherwise an invalid query exception is raised. Normally this is fine but when running more complex queries a primary key may not be available or even make sense.
There is a simple ...
Written by Sean Behan on 07/15/2017
How to Resolve ERROR 1396 (HY000): Operation CREATE USER failed for Error in MySQL
If you run into this error when trying to create a user in mysql, chances are you already have this user account created.
create user 'someuser'@'localhost' identified by 'somepassword';
ERROR 1396 (HY000): Operation CREATE USER failed for 'someuser...
Written by Sean Behan on 03/02/2017
Installing RedMine PM Software on Apache with Phusion and REE and Seeing a 404 Page Not Found Error on Installation
If you follow the instructions on how to install the Rails Redmine PM Software (available here) and are using Apache with Passenger (REE), you need to delete the .htaccess file that is kept in RAILS_ROOT/public directory. Otherwise you'll see a 404 page n...
Written by Sean Behan on 06/17/2012
Trouble Using Attr_Accessor in Rails Models and Forms
You might use the attr_accessible method to create getters and setters for a class that has attributes which don't map directly to corresponding fields in a database. For example let's take the scenario where you are processing a credit card transaction. ...
Written by Sean Behan on 06/17/2012