Automatically Creating Related Objects in Django

Screen Shot 2018-04-28 at 10.19.11 PM

At its core, SafeButler is a software technology company. Our engineers are building sophisticated software to fulfill our mission of managing and automating insurance for consumers. From time to time, we’ll publish technical tips from our engineers as they solve interesting problems.

Today’s tip is about how to automatically create related objects in Django. Imagine a database model has a table for User and another table for UserProfile. There is a 1:1 relationship between the two tables. Ideally, whenever a User object is saved, its corresponding UserProfile should be created, linked and saved automatically. That way, the User object won’t have a null UserProfile.

Using Django’s signal provides a nice solution. As illustrated below, we use @receiver decorator to automatically create a UserProfile object upon creation of a User object. The two objects are linked to each other too. Done. Nice and simple.

from django.db.models.signals import post_save
from django.dispatch import receiver

@receiver(post_save, sender=user)
def create_user_profile(sender, instance, created, **kwargs):
    if created:

@receiver(post_save, sender=user)
def save_user_profile(sender, instance, **kwargs):

Excited about what we do

Our mission is fixing the pain in insurance for consumers. It always excites us when our users tell us they appreciate what we do. Recently a user named Carl sent us the note below.

Wow great job! I have been complaining about switching my auto insurance for months and verbally stated I wished a company like yours existed. And then I heard about you guys. This has been incredibly delightful and helpful so far and I look forward to finalizing. Maybe I can send you guys some beers as a token of my gratitude.

Thank you, Carl! It means a lot.

Is Social Security Number needed for Auto Insurance Quotes in California?

A user recently moved to California and came to for his Auto Insurance. After signing up, he asked us an interesting question over chat, “Back where I lived, I had to provide my Social Security Number to obtain Auto Insurance quotes. Why doesn’t SafeButler need that?” Our answer was “You are not in Kansas anymore. This is California.”

Insurance is regulated state by state. Back in 1988, California voters approved Prop 103. Among other consequences, it prohibits insurance companies from using consumer credit scores as a rating factor. Thus Auto quotes in California do not need the SSN.

Thirty years later, Prop 103 remains a hotly contested topic. Insurance companies argue that it deprived them of one of the most accurate rating tools. On the other hand, consumer advocacy groups hail it as a big win for consumers. California Department of Insurance, the state’s insurance regulator, cited studies that claimed Prop 103 saved California consumers over $100B in 25 years since its approval. Whether Prop 103 is responsible for it or not, it is a fact that California’s insurance rate has been largely flat since 1988 while the national average has increased 43%.

One thing is for sure. As we tell our users if a website asks for the SSN to quote Auto Insurance in California, either the site doesn’t know what it is doing or it may be a fraud.

To bundle, or not to bundle, that is the question


As an insurance consumer, you have probably heard the pitch from an agent or carrier that you should move all your auto/home/landlord/motorcycle/life policies to the same carrier. Why? You get the bundling discounts to save money. Is that really true?

Well, most carriers do offer some bundling discounts. But it doesn’t always mean you save money by bundling. For instance, we have seen cases where carrier A offers cheap auto quotes with expensive home quotes while carrier B offers expensive auto quotes with cheap home quotes. Instead of getting a discount from a high bundled price from either carrier, our users saved money by putting their auto with carrier A and home with carrier B.

To figure out the best choice for our users, our computer recommendation system shuffles through a ton of combinations, bundled or unbundled. This is a task that human agents rarely perform, for multiple reasons. First, the amount of work required is generally too much for humans. Second, more importantly, a carrier has no incentive to put any client with a competitor even when unbundling means a better deal for the consumer. As SafeButler, we take pride in putting consumers first. As the Earth’s most consumer-centric insurance organization, we invite all insurance consumers to hold us accountable to that bar.

Protecting Yourself from Your Own Insurance Company

No, the title is not a typo. Seriously. Time and again, we’ve heard stories from people about how their claims are poorly handled by their own insurance companies. Here is a real story that happened recently. A friend of ours came to a stop at an intersection. He started driving forward when the light turned green. Coming from the right, in an attempt to race across the intersection, another car drove right past in front of him. His car caught the rear bumper of the other car and knocked it out of control. Airbags were deployed in both cars. Luckily nobody was hurt. But that also meant the police declined to come to the scene. The drivers exchanged insurance cards and found out both were insured by the same insurance company, one of the most well-known names.

What transpired in the claim processing infuriated our friend. The insurance company wanted him to accept 30% of the fault! The cited reason was that the other driver claimed that the light was yellow for her when she raced into the intersection. In this case, since the insurance company is paying from its left pocket to its right pocket, it had little motivation to get to the bottom of the truth. In these his-words-against-her-words type of claims, it is quite common that the insured finds himself getting little help from his insurance company.

Enter the hero that saved the day for our friend, his dashboard camera. In its clear video footage, it was shown without a shadow of a doubt that his car started moving only after the light turned green, which in turn meant that the light for the other driver must have turned red!


You can find a lot of good dash cams online that are reasonably priced and easy to install. Here is Amazon’s Choice¬†for less than $50. Maybe it should be the Christmas gift for yourself. ūüėČ Be safe, be savvy!

How does a Homeowner Policy Cover a Wildfire Loss?


Except in areas where wildfires are common (often known as high fire line score areas), Homeowner Insurance covers losses caused by wildfires in general. Here is a breakdown how each coverage item in a Homeowner policy helps after a home is damaged or destroyed by a wildfire.

Dwelling: This covers the repairing or rebuilding the home and attached structures to what they were before the fire, up to the coverage limit. The coverage amount is usually lower than the market value of the home which includes the value of the land. In high priced real estate markets such as the Bay Area, it is quite common to see homes that are sold for a couple of millions. Their reconstruction cost, and thus the needed Dwelling coverage amount, is actually often a fraction of the market value.

Other Structures: This coverage repairs or rebuilds detached structures such as fences, sheds or detached garages. It is often 10% of the Dwelling coverage amount.

Personal Property: This coverage replaces the lost belongings, such as clothes, electronics, furniture. There are two important things to know about this coverage. First, there are two different types of replacements, Actual Cash Value (ACV) and Replacement Cost (RC). ACV covers the fair market value typically. For instance, if a jacket is lost in the fire, ACV covers the amount to buy a similar¬†used jacket on eBay. On the other hand, RC covers the cost to buy a similar new jacket. It is almost always worth the little extra money to get Replacement Cost. Second, there is usually a fairly low coverage limit for expensive items such as jewelry, furs, art, guns, etc. If you have any of those, you can buy an endorsement or a scheduled¬†personal property coverage specific to your high-value item. You may even need an appraisal. Pro tip, it may be a better option to store the high-value items in a bank’s vault than buying insurance for them, particularly if the items have personal or emotional connections. It’s probably a good idea to take an inventory of your belongings annually. We are working on tools to make it easy for you.

Loss of Use: After a fire, the home may become inhabitable until repaired or rebuilt. This coverage pays for renting a home or staying in a hotel, up to the limit in either time or dollar amount.

Personal Liability: This covers damages caused by the homeowner in almost all situations except in auto accidents, which should be covered by the liability coverages in the Auto Insurance. It is an important coverage for the homeowner’s financial security. For homes that are right next to each other in a city like San Francisco, this coverage is even more important. Imagine a fire starts in your kitchen. It not only damages your home but also the neighboring homes. This coverage helps you make the neighbors whole. The good news is that getting a $300K Personal Liability coverage costs only a tiny more than a $100K coverage. We usually recommend at least $300K for this coverage. Some Umbrella Policies may even require the Homeowner Policy to have $300K Personal Liability coverage.

Medical: This pays for the medical cost of the residents or visitors regardless of fault, up to the limit. Besides other restrictions, the limit is typically not high enough for major accidents. So it is not a replacement for a good health insurance and an Umbrella policy.

Extended Replacement Cost: Right after a wildfire destroys multiple homes in an area, the demand for construction labor and material is likely to soar. The Dwelling coverage may become insufficient to rebuild the home due to the resultant higher labor and material cost. This coverage provides additional coverage for the reconstruction. Sometimes in an attempt to allure consumers with a lower price, an insurance broker or agent may quote a Homeowner policy with zero Extended Replacement Cost. Be aware and thorough when comparing coverages between quotes.

Suffering a loss in a wildfire is extremely stressful. It can be helpful to prepare for the unexpected by having a solid Homeowner policy and knowing what and how much will be covered.

Can I buy (more) home insurance when a wildfire threat is imminent?

wildfireSome communities in California suffered tremendous loss in recent wildfires. According to United Policyholders, a consumer advocacy group, more than half of the fire victims did not have enough insurance coverage to repair or rebuild their homes. The gap averaged over $100,000. When serving our users with home insurance, we see a similar pattern of under-insurance. In these cases, we always recommend they bring the coverage amount to reflect a more accurate rebuilding cost. Using technology, we also automatically monitor the coverage amount going forward to ensure proper protection.

Interestingly, one of our users asked a question in response to our recommendation. “Why can’t I increase the coverage amount when a wildfire threat is imminent? That way, I don’t have to pay as much now and still get the protection when actually needed.”

Well, if the user indeed tries this, he will be surprised to find that, when a wildfire burns near his home, the insurance companies won’t allow any increase in coverage amount or any reduction in deductibles. They also won’t sell any new homeowner policy. It is called “binding restrictions“. When a binding restriction is in place, there is nothing an insurance agent can do to increase the protection unless a request for change was already initiated.¬†Binding restrictions also occur during other natural disasters such as hurricanes, tornadoes, and flooding.

Upon hearing the explanation, our user happily took our recommendation. At SafeButler, we know that insurance is complicated and boring for most consumers. That’s why we take pride in making sure every user is well protected without them spending mental energy on it. For users that want to dig deeper to better understand our recommendations, we are always happy to explain. After all, we are your advisor and butler when it comes to insurance. ūüôā