Home

Powered by Django

A toolbelt for the next 2-4 years and beyond

Date: Jan 15, 2017

I was going to present all this information in a Twitter thread, but then I realized my descriptions could easily stretch into dozens of tweets. At that length, it should be in a blog post. Still, I'll try to be brief.

  1. www.whoismyrepresentative.com: If you only bookmark one site, let this be it. Plug in your zip code, get a list of your members of Congress. Click on each members' name to get a directory page with urls and phone numbers. Extra credit: add those numbers as Favorites in your phone contacts and use them often. (Also, check out the public API.)
  2. www.senate.gov and www.house.gov: These are the official web sites of our legislative branch. The Senate web site is a little more useful in terms of finding the results of things like roll call votes and upcoming legislation, but both require some navigating around to find anything useful.
  3. projects.propublica.org/represent/: While I recommend bookmarking the above Congressional sites for reference, ProPublica's Represent project is eminently more readable and useful for finding the latest on House and Senate votes. They also have an API.
  4. www.sunlightfoundation.com: Although ProPublica took over a lot of Sunlight Foundation's data tools last year, the Sunlight Foundation is still active! Especially useful is their local open data policy page.
  5. www.opensecrets.org: This is how you find out where the money comes from. The Center for Responsive Politics maintains a comprehensive database of publicly available political contribution data. Their search/navigation is not the most intuitive, but with a little work you can figure out, say, who were the top contributors to the Republican Party in 2016. Or see a record of your own political contributions.
  6. www.ballotpedia.org: BallotPedia is probably best known for their sample ballot lookup; I rely on it to learn about candidates and initiatives in local elections when local voter information resources fall short. But they also have a comprehensive calendar of upcoming state and local elections, something that's going to be important in the coming years (yes, you should be paying attention to what's happening at the local level - it's a great opportunity to start effecting change).
  7. www.regulations.gov: Did you know this was a thing? There are a lot of Federal policy changes that don't even happen in Congress - they're announced by Federal agencies, and the public gets to comment. This site lists proposed changes and gives you, a presumed member of the public, a place to make those comments. Getting through the language and legalese can be cumbersome, but it's worth skimming this site every few days just to get an idea of what's going on.

Coming soon: A post about reliable news sources I read every day, and another one about who needs your donations right now (hint: it involves @ProgressGive).

Powered by Django

Interviewing While Female

Date: Sep 14, 2016

This year has thrown a couple of tough interviews my way - nothing too difficult technically, they just didn't work out for one reason or another.

I've always been a nervous interviewer - clearly I have skills or I wouldn't have been employed as a developer for the last fifteen years. But when I'm under interview pressure, you could ask me to concatenate two strings and I might choke.

Okay, that's an exaggeration, but performance under pressure is certainly something I struggle with, and I know I'm not alone.

So it sucks that my gender should be an additional challenge. We have so many problems with diversity and inclusion in this industry, and so I have to consider how people perceive me because of my gender, for better or worse.

It wasn't always that way - my first programming job was on a dev team made up entirely of women. The only men in the building were artists. Even the 'IT guys' were women. I had no idea how unusual that was. The thing is, I don't think it was so unusual at the time.

Maybe that's why I didn't give a lot of thought to the teams I was joining in the years that followed. All that used to matter was the job itself. There were often a few other women around - I was only alone when the teams were small, 3-4 people, and I never felt isolated or alienated then.

I bring all this up because at one point during my recent job search, I went through the interview process with a company that gave me pause.

They sounded great on paper, they ticked all my boxes in terms of having challenging and varied work. But as we were setting up the tech interviews, I found out that I would be the only woman on a team of 50 or so. Not only that, but this company has a nearly 20-year history and has never employed a woman as a backend developer.

Whether the company's bias is deliberate or unconscious, it's clear that they have not made an effort to improve the diversity of their team in the decades before now. That's not just bad business planning, it's a huge red flag for me, an indicator that I would have a tough road ahead if I joined them.

And the weight of expectation would be crushing. If I did interview, I'd feel as though I were representing my entire gender. If I stumbled, it wouldn't just be me that looked bad in their eyes, it would be all women programmers.

Someone has to go first and open those doors for other women at this company, but why did it have to be me?

I wish I had the luxury of looking at a potential programming job solely on its merits. But these days I have to consider the environment I may be wandering into.

For the record, I did go through the first few rounds of the interview process, because practice is never a bad thing. However, I stopped short of the final steps because I knew I wouldn't be able to accept a job offer there. The whole situation was too fraught, I knew I wouldn't love it. I couldn't be certain that I would be treated with respect or even taken seriously.

I'm a competent, smart programmer and a good problem-solver who struggles with interview nerves. Interviews are hard enough, I shouldn't have to carry the extra weight of inclusion concerns with me too.

I don't know how to fix these things. I don't have a lot of answers.

But if you're a technology business that can't find women to bring onto your development team, maybe the problem is you - or at least your process. So adjust your message, try a different approach.

If you're not finding women to interview, then you're not looking - I promise you, we're everywhere.

And if you're interviewing and not finding any of us competent enough to hire, the problem is you. I guarantee it.

Incidentally, I finally wrapped up my job hunt and accepted a new position recently. I'll be starting next week, so for those of you who follow me on Twitter, expect to hear more about it there. The new position is a slight change of direction for me, and I'm a little uneasy about being in a position where I am no longer the expert on everything and instead have to learn a lot of new skills very quickly. I think it'll be an exciting challenge though.

Wish me luck!

Powered by Django

Dynamic Inlines in the Django Admin

Date: Aug 03, 2016

I'm not sure how many of you know this, but in the interest of having a well-rounded life, I make a lot of things in my spare time. Over the years, I've been a costumer, a jeweller, a photographer, and a glass artist, among other things.

And I don't just mean dabbling - when I get interested in learning something, I throw myself into it almost to the point of fanaticism.

I make a lot of things. Which means I have a lot of things filling up my closets and drawers. There's only so much I can gift for birthdays and holidays. So lately I've opened up a shop on Etsy.

Opening shops in online marketplaces has meant keeping track of a lot of things around inventory. Etsy's listings manager is nice, but it doesn't really give me everything I want. For a while, I've been using a spreadsheet to keep track of my Etsy listings. But I'm also about to open a shop on Spoonflower. And I'm considering ArtFire. And I need a better way to manage the supplies I use. And I want to keep all this stuff in one place.

Naturally, because I'm a programmer, I'm building my own inventory manager.

I just started a day ago, so there's obviously a lot of work ahead - I hadn't given a lot of deep thought to what the account and item models needed to look like, so I've been making liberal use of migrations. (I should point out that I'm using Django 1.9. I love it - I've been mired in 1.3 for a while at work, used 1.6 for a few small personal projects, and made it onto 1.8 for some more recent work projects. I love the slight changes in the admin look, and finally having the built-in migrations is a dream come true.)

The items I'm storing use a base Item model with a lot of common fields like name, description, and price. But Etsy listings also use some values that are unique, such as Etsy-specific categories, when the item was made, a list of materials to use as search tags, and so on. Meanwhile, Spoonflower listings take a totally different set of parameters, such as material type, colors, and the type of repeat you want to use for your image.

For each marketplace (so far just Etsy and Spoonflower), I've added models for values that are only needed when the item is listed on that market.

class EtsyItem(models.Model):
    """
    Fields used when the item
    is listed on 'Etsy'
    """
    item = models.ForeignKey(Item)
    ...

class SpoonflowerItem(models.Model):
    """
    Fields used when the item
    is listed on 'Spoonflower'
    """
    item = models.ForeignKey(Item)
    ...

This structure does assume that an Item wouldn't be listed on multiple markets - I may leave it that way and just add functionality to allow one Item's basic values to be copied to another record, to be associated with a different market so that each listing is unique.

I did also consider subclassing the Item model, but I'm serious about wanting to keep everything in one place - I'd rather not have to manage items in an Etsy list versus a Spoonflower list, etc. Maybe I'll change my mind about that and rewrite this whole thing.

But in the meantime, keeping everything together under that Item model presented a challenge - how to add/display the marketplace-specific data for an Item in the admin? I wanted to be able to show the Etsy model as an inline for an item listed for Etsy, a Spoonflower inline for a Spoonflower item, and so on.

Here's what I did (and of course you can see this in the inventory/admin.py in the repository):

from .models import EtsyItem, SpoonflowerItem

class EtsyItemInline(admin.StackedInline):
    model = EtsyItem
    extra = 1
    max_num = 1

class SpoonflowerItemInline(admin.StackedInline):
    model = SpoonflowerItem
    extra = 1
    max_num = 1

I started with inlines for each of the custom models. Each Item should have only one of its respective inline objects - setting "extra=1" and "max_num=1" ensures that one instance of that inline will load but that no additional instances can be added to the page.

class ItemAdmin(admin.ModelAdmin):
    ...
    inlines = [
        EtsyItemInline,
        SpoonflowerItemInline,
    ]

But I still needed a way to prevent all of the inlines from being loaded. An Item sold on Etsy should only have the EtsyItemInline, an Item to be sold on Spoonflower should only load SpoonflowerItemInline, and so on.

The first thing I needed to do was make it clear which online marketplace an Item is being sold on. So I went back to the model. My base Item model has a ForeignKey relationship to a seller account, which is in turn associated with a market name - I added a method extra_fields_by_market() to return a string (the desired inline name, based on the market name).

class Item(models.Model):
    account = models.ForeignKey(SellerAccount)

    ...

    def extra_fields_by_market(self):
        extra_inline_model = ''
        if self.account.market:
            extra_inline_model = str(self.account.market)+'ItemInline'
        return extra_inline_model

Then back in the admin, I overrode get_formsets_with_inlines(). This method yields formset/inline pairs, which allows me to limit which inlines are displayed for a given object.

I was able to use it to display a specific inline only when it matches the market on a base Item:

class ItemAdmin(admin.ModelAdmin):

    ...

    def get_formsets_with_inlines(self, request, obj=None):
        for inline in self.get_inline_instances(request, obj):
            # hide/show market-specific inlines based on market name
            if obj and obj.extra_fields_by_market() == inline.__class__.__name__:
                yield inline.get_formset(request, obj), inline

The value of obj.extra_fields_by_market() is that string returned by the model - 'EtsyItemInline', 'SpoonflowerItemInline', etc. If that matches the name one of the defined inlines, that inline is returned.

I should also note the other condition - if obj. We don't know what market an Item will be listed on until after it's become an object in the database - this means a user would have to fill in the base Item fields, save, then come back to find the additional fields displayed as an inline.

If I were better at Javascript, I would have gone in a different direction immediately and had the inline load triggered by the account/market dropdown selection in the base Item.

I'll figure that out in a day or two, whenever I get a chance to turn my attention back to the project. Or I'll rewrite the whole thing a few times because I'm not quite satisfied with the data structure. But for now hopefully I've given you some new ideas for ways to manage inlines in your admins.

Powered by Django

Bonus Points For Project-Based Interviews

Date: Jul 27, 2016

I'm in the middle of a job hunt right now, and so I'm thinking about a lot of issues as they relate to questions I'm asking during interviews. How do these companies determine 'culture fit'? How do I know whether or not their culture is inclusive? Will I be taken seriously, will I be listened to?

But the question that's obviously giving me the most headaches is whether or not I'll come off sounding knowledgeable during an interview. That's natural, right?

After 15 years in this field, I still suffer a little from impostor syndrome, and nowhere does that show itself more clearly than when I need to stifle it the most - during an interview.

Classic Q&A-style tech interviews are such a challenge for me. I am not great at regurgitating facts out of the standard library documentation. That's especially true when I'm being interviewed by a man (or group of men) - there's an unfortunate dynamic there that makes me question whether or not I belong.

But you know, that's not how I use Python every day anyway. You don't really want to gauge how well someone has memorized the standard library docs. In day-to-day programming work, it's not about what you've memorized - it's about knowing what to look up, knowing what questions to ask.

What you really want to know is how they approach problems, and how well they solve them. But asking someone to write a function or debug some code doesn't work as well either. I've had tasks like that as an interviewee. They might seem simple, the kinds of problem-solving exercises that might normally only take a few minutes, but when you're being watched, knowing you're being judged and scrutinized, those simple problems can become monumental.

And that's also not a reflection of how problems get solved in the real world. In a real development environment, there's collaboration, often there's more flexible time.

What I really prefer are project-based interviews - what are sometimes called take-home assignments - where I can develop some code beforehand and then explain my decisions to an interviewer. I've had a lot of success with this type of interview - from both sides of the process. It makes the interview feel less like a pressure cooker and more like an opportunity to show you what I can actually do.

How it works:

Then on the day of the interview, spend some time going over the code and examine the decision-making that went into it.

I understand the argument that this kind of exercise takes up too much free time for the interviewee. But as said interviewee, my position is this:

As programmers (particularly in open source), we're expected to write code in our spare time to contribute to open source libraries and projects, so that we can be judged on the quality/amount of that code. We're expected to write tech blogs and contribute in all kinds of other ways. All of that is unpaid work, usually done in our free time.

But somehow a few hours writing a take-home assignment is too much time to spend? For not-the-right-job, yes, I agree that it would be too much. But for the right job? I would feel just as excited about writing that code as I would about any other open source contribution.

Powered by Django

Looking Ahead

Date: Jul 22, 2016

After nearly four years at my current company, I am looking for something new. I love my team, and I'd happily stay here longer (the challenges laid at my feet over the years have been exciting). But the business has made a decision to eliminate Python, sunsetting all the current projects by the end of this year, so I am beginning my search for a new software development opportunity.

Who I am and what I do

What's important to me

My favorite parts of dev work: Debugging, scripting, writing APIs, writing tests, deleting code, managing releases, optimizing data stores, writing documentation

The parts I could live without: Front-end work (I'm not opposed to writing CSS and JavaScript, they're just not my favorite things).

The nuts and bolts of my software development background are in my online resume, and I've got a lot of professional recommendations on LinkedIn.

Feel free to contact me at barbara.shaurette@gmail.com.

Bonus Points For Project-Based Interviews

Powered by Django

A toolbelt for the next 2-4 years and beyond

Date: Jan 15, 2017 | Category: Personal

I was going to present all this information in a Twitter thread, but then I realized my descriptions could easily stretch into dozens of tweets. At that length, it should be in a blog post. Still, I'll try to be brief.

  1. www.whoismyrepresentative.com: If you ...

    Read More

Powered by Django

Interviewing While Female

Date: Sep 14, 2016 | Category: Personal

This year has thrown a couple of tough interviews my way - nothing too difficult technically, they just didn't work out for one reason or another.

I've always been a nervous interviewer - clearly I have skills or I wouldn't have been employed as a developer for the last fifteen ...

Read More

Powered by Django

Dynamic Inlines in the Django Admin

Date: Aug 03, 2016 | Category: Django Django1.9

I'm not sure how many of you know this, but in the interest of having a well-rounded life, I make a lot of things in my spare time. Over the years, I've been a costumer, a jeweller, a photographer, and a Read More

Powered by Django

Bonus Points For Project-Based Interviews

Date: Jul 27, 2016 | Category: Personal

I'm in the middle of a job hunt right now, and so I'm thinking about a lot of issues as they relate to questions I'm asking during interviews. How do these companies determine 'culture fit'? How do I know whether or not their culture is inclusive? Will I be taken ...

Read More

Powered by Django

Looking Ahead

Date: Jul 22, 2016 | Category: Personal

After nearly four years at my current company, I am looking for something new. I love my team, and I'd happily stay here longer (the challenges laid at my feet over the years have been exciting). But the business has made a decision to eliminate Python, sunsetting all the current ...

Read More

Powered by Django