There are situations, when you or other modules alter username via hook_username_alter() and this can change username dramatically: for example, you can alter username into a combination of First and Last Name, etc.

Django sitetree is a great app to manage your Django app menus. Sometimes, you'll have a page that you want to manually put under a sitetree, so how to do that? At first we need to patch a sitetreeapp.py like this:

To compare two times you need to do the following:

If you have a parent model that has OneToOne relation to some other model and you want this child model to be created upon parent model creation you need to install django-annoying package like this:

pip install django-annoying

enable annoying app and replace your models.OneToOneField with AutoOneToOneField like this:

Surprise, surprise, when you want to perform some actions on model delete, overriding delete() method may be not enough, because when you do bulk delete of models via admin interface it won't touch model's delete() method. The way out of it is using signals:

If you've missed DrupalCon Prague 2013 or, maybe, you want to relive once again this great party go and see all videos from the event on this page: all DrupalCon 2013 Prague videos. Or use the playlist embed below. There you'll find 4 days, 7 hours long video material (104 videos)!

The easiest way to do this is to set up your script as a manage.py subcommand. Here's how to do that:

from django.core.management.base import NoArgsCommand, make_option
 

Pages

Subscribe to TimOnWeb RSS