"Error: Oh my god you've ruined EVERYTHING, AGAIN! You old bag!"This is really quite good at being unfriendly, see, cuz old people have probably ruined everything at least once at their age and probably live their lives dreading that they might do it again...
Friday, September 25, 2009
Err messages....
For the project I'm working on currently, they don't want to let 'unfriendly' (meaning too technical) error messages through.. I think all error messages should be unfriendly because when they are relayed to the devs on the backend, it helps them track down exactly what the issue is much faster. But then again, my code does contain the error message:
Thursday, September 24, 2009
Emacs Bookmarks
`C-x r m '
Set the bookmark for the visited file, at point.
`C-x r m BOOKMARK'
Set the bookmark named BOOKMARK at point (`bookmark-set').
`C-x r b BOOKMARK'
Jump to the bookmark named BOOKMARK (`bookmark-jump').
`C-x r l'
List all bookmarks (`list-bookmarks').
from someone at cmu
Set the bookmark for the visited file, at point.
`C-x r m BOOKMARK
Set the bookmark named BOOKMARK at point (`bookmark-set').
`C-x r b BOOKMARK
Jump to the bookmark named BOOKMARK (`bookmark-jump').
`C-x r l'
List all bookmarks (`list-bookmarks').
from someone at cmu
Friday, August 28, 2009
How to uninstall python packages with easy_install.
Wednesday, August 26, 2009
How to revert a file or directory in svn.
Revert a file to revision 854
svn merge -c -854 l3toks.dtx
Grabbed from stack overflow.
Revert a directory to revision 854
svn merge -rHEAD:854 .
Grabbed from some code monkey.
svn merge -c -854 l3toks.dtx
Grabbed from stack overflow.
Revert a directory to revision 854
svn merge -rHEAD:854 .
Grabbed from some code monkey.
Friday, August 7, 2009
Difficult errors to debug in Django for Django noobs..
Got this as an debug template page today:
After some digging around and frustration, I finally figured it out. I had created a new app for my project called `newsbin`, then created a model and views and set the views up in urls.py, but I had not yet added `newsbin` to the installed apps section of settings.py. Thus it gave the above error.
TemplateSyntaxError at /admin/
Caught an exception while rendering: name 'User' is not defined
After some digging around and frustration, I finally figured it out. I had created a new app for my project called `newsbin`, then created a model and views and set the views up in urls.py, but I had not yet added `newsbin` to the installed apps section of settings.py. Thus it gave the above error.
Wednesday, July 29, 2009
Command to copy a vdi in virtual box on a linux machine.
Make sure the vm using the original vdi is not running and then release and remove (Choose KEEP) the vdi from the pool of drives. Then run
Once that is done be sure to re-attach the original vdi.
VBoxManage clonevdi /Original.vdi /NewCopy.vdi
Once that is done be sure to re-attach the original vdi.
Monday, June 29, 2009
Adding a field to the django auth user.
I've been trying to do this for a while and I keep finding how-to's such as Extending the Django User model with inheritance, but the problem with these methods is that you still cant sign-in to the django admin with any users you create (such as the admin you set up at the beginning of the project).
I finally got the monkey-patching method to work by doing the following.
You can add fields to the user class with the method add_to_class instead of inheriting the User class by doing the following in your models.py:
Once that is done, in admin.py, modify the UserAdmin and add your new field
I finally got the monkey-patching method to work by doing the following.
You can add fields to the user class with the method add_to_class instead of inheriting the User class by doing the following in your models.py:
User.add_to_class('new_field', models.BooleanField(default=False))
Once that is done, in admin.py, modify the UserAdmin and add your new field
from django.contrib.auth.admin import UserAdminVoilĂ , with that done, you're new fields should show up in the auth user on the django admin page.
UserAdmin.list_display += ('new_field',)
UserAdmin.list_filter += ('new_field',)
UserAdmin.fieldsets[1][1]['fields'] = ('first_name','last_name','email','new_field')
Subscribe to:
Posts (Atom)