Monthly Archives: May 2013

Its all coming together really well : Google I/O keynote

What Google did at the I/O keynote was truly amazing. Put another way , I never really appreciated what convergence really meant till the keynote was done. I was convinced, THIS is THE most tightly knit, focussed and convergent company that exists right now. YES, Google presented a unifying vision at its I/O keynote , a vision more crystallized and consistent than Apple, Facebook, Twitter , Netflix , Microsoft, Sony or Amazon have laid out in the past 5 years.

When Larry Page took the stage at the end of the keynote. It became very clear that HE was the person behind the amazing coming-together of all of Googles disparate entities into one congruous whole. He was the person who led Google from the company that reluctantly dabbled into social networking to a company that built a powerful social layer that integrates seamlessly across its entire ecosystem.

It takes guts for a search company to keynote a section titled “The end of search”, it takes serious guts for a company to welcome competition in every sphere of its activity by continuing to build open systems, it takes even more guts for a company to invest time and energy into so many activities because they can , regardless of the profit motives behind it.

Think about it, this is a company that stitched together every LANDSAT image taken since the dawn of the program and made it available free for us all to use, This is a company that sent hikers with imager-backpacks on every trail in the US,sent underwater imagers into coral reefs and the amazon and uploaded all the data to the web, free for us to use and benefit from , because they CAN. This is a company that added a streetview layer on top of a majority of maps they publish , an image of every street they have driven down. This is a company that is creating a driverless car. This is a company that actually thinks of what it means to have an inter-planetary internet and uses the technology to bring the internet to remote reaches of our own planet.

And even though many media stories on Google , including yesterdays New York Times article follow the narrative that Google did something because of Apple, Facebook or . It was even more clear after this weeks keynote that while Google did get pushed into many areas to compete with others , it has now more than hit its stride. Every area that Google entered, it has built products or solutions infused with its DNA through and through. DNA that sets them apart from every other player in the field. A DNA which has openness at its very core!. A DNA which builds something just because it should be possible!.A DNA which embodies what JFK stated in his famous speech about going to the moon , Google chooses to tackle all these problems and more not because any of them are technologically feasible when they started , not because any of them are easy..but because they are hard!

There is something to be said for launching apps on a competitor platform simultaneously with a platform you own and control ( the Hangout app they launched last week ). I could download a books app that allowed me to load every non DRM book I own onto a Google app and it syncs automatically across all devices, regardless of which company makes that device, once again a testament to Googles openness.

While many criticize Google for building chrome , forking java , abandoning XMPP , JPG , H.264 or some other web standard, Google once more sent the message that they will do everything in their power to enhance the open web while relentlessly working to keep it moving forward , making it faster and better and YES more open! Granted many of these standards are Googles new “standards” , granted it drives a wedge in some otherwise open system used by the web..but there is no denying that the new proposal is always better and always open.

The message that came through loud and clear is that the vision that Larry and Sergey had for Google is stronger than ever. The big plans are only gettting bigger and Yes most importantly OPEN is winning. Its winning because its what makes Google, Google and allows them to make products that continue to fill ever growing technology niches. OPEN is the glue that binds it all together into one congruous whole that will continue to amaze us in the years to come.

Image credit: Alex Washburn / Wired ( creative commons )

Customizing you Django user admin with Inline sections

Screen Shot 2013-05-12 at 3.56.43 PM

I was using django-userena for user management on a django app. Userena is a django app that works with “django.contrib.auth.user” to provide additional features such activation, password resets over email and messaging in addition to signin and signups.

With Userena the django Auth admin site had a number of “Inline” management sections that incorporated the information coming in from the Userena app relevant to the particular user.

The sections were:
Personal Info
Important Dates
Userena Registrations

I wanted to add my Custom profile to the Bottom of that list. My custom profile , otherwise also known as the one you set as the “AUTH_PROFILE_MODULE”

AUTH_PROFILE_MODULE = “accounts.MyCustomProfile”

How does one do that?

Well basically you want to extend the “custom” admin interface . The relevant django doc for all things ModelAdmin is located here.

My model which I want to add in: is

from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from userena.models import UserenaBaseProfile

# Create your models here.

class MyCustomProfile(UserenaBaseProfile):
    """The Userena User profile"""
    user = models.OneToOneField(User,
    bio = models.CharField(max_length=1000,default="",blank=True)
    # Make this field not editable because it controls access to uid from legacy db
    my_legacy_user_object = models.SmallIntegerField(null=True,editable=False,unique=True)

    def __unicode__(self):

To accomplish the inline display of this model along with the rest of the stuff userena already put into the admin page for the user I had to add this as my for the accounts app.

__author__ = 'hari'
from django.contrib import admin
from .models import MyCustomProfile
from userena.utils import get_user_model,get_profile_model
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from userena.admin import UserenaAdmin,UserenaSignupInline

class MyCustomProfileAdmin(admin.ModelAdmin):
    list_display = ["user" ,"bio","my_legacy_user_object"]
    search_fields = ["user__first_name","user__last_name","my_legacy_user_object"]

#docs from,MyCustomProfileAdmin)

class MyCustomProfileAdminInline(admin.StackedInline):
    model = MyCustomProfile

class MyCustomProfileAddedAdmin(UserenaAdmin):
    inlines = [UserenaSignupInline,MyCustomProfileAdminInline],MyCustomProfileAddedAdmin)

The result is what we get nicely here