When are so-called “patriots”, or even fucking “nationalists” going to start caring about Trump’s continued disrespect for those who serve and sacrifice for this nation?

> Trump never served because of bone spurs – but bone spurs never stopped him from doing anything else
> Trump joked that having sex in the 70’s was his “personal Vietnam”
> Trump belittled John McCain’s time served as an American POW, saying “I like people who weren’t captured”
> After two years, the president still hasn’t visited troops in combat
> Trump sent Pence to lie to the troops in January 2018 saying Democrats were playing politics with their pay, after Republicans blocked a resolution to pay troops during a possible government shutdown.
> Trump compared his “sacrifices” to those who died on the battlefield. By “sacrifices” he meant working to make money
> Trump insulted the family of a fallen hero.
> And now, Trump skipped visiting a cemetery for American soldiers because it was drizzling

Advertisements

People are chuckling about the doctored video and I’m thinking, “Holy Shit!”

I would have liked it if publications like The Hill and Huffpo didn’t use the word “accuse” in their headlines about Sarah Sanders sharing a doctored video to promote the lie about Jim Acosta “placing his hands on a young woman”. The video is definitely doctored and she definitely shared it. Since when do we say someone is “accused” of tweeting something that she tweeted?

The Washington Post has a good side-by-side so you can see how the video was altered (along with a good suggestion about how this should be handled).

And the Independent nailed it:

Many social media users accused Ms Sanders of posting footage which sped up the contact to make Mr Acosta’s movement appear more aggressive.

But according to analysis by The Independent, the video instead appears to have been doctored to freeze for three frames the moment before Mr Acosta’s hand pushes down on the aide’s arm.

Sure, they used the word “accused” but only to differentiate the assumed method by which the video was doctored with the actual method. That the video was doctored is not in question.

And The Independent’s analysis is right. If you stop the video and use your mouse to slowly slide back and fourth at around time 0:14, you will see where the frame freezes for a moment. After the frozen part there is a jump to the next frame, and there it looks like Acosta made a chopping motion when what really happened was his arm brushed against hers.

Word of this malfeasance is spreading throughout social media, but I don’t think enough people are saying “Holy Shit!”. I’m saying “Holy Shit!” for two reasons.

First, The nation’s highest office is using doctored evidence to support a lie, and using that lie to justify action against a reporter. Think about all those “lock her up” rallies and how close we are to becoming the kind of nation that locks up the political opposition. Well I think we just got a lot closer.

Second, video technology is scary. Today it’s a cheesy alteration that several entities were able to point out. Tomorrow it could be advanced computer aided editing that’s not so easily discerned.

We’re not going to be able to tell truth from fiction by ourselves. We need people who have dedicated their lives – and in many cased risked and sacrificed their lives – to bring us the truth.

We need to protect our press.

Love and Protest

So let me put it this way. Imagine a brave hero dies saving your mom in the line of duty. Maybe a police officer. Maybe a fire fighter. Whatever. A hero. Saves your mom.

Now image a few years later, your mom picks you up from the airport for Thanksgiving dinner. And she’s drunk. And she’s driving and you smell the alcohol and you’re like, “Mom! Are you drunk?” and she just gives you a dirty look and changes the subject.

And then you find out that she doesn’t even have a licence anymore. And you’re like, “Mom – Holy Shit! You gotta stop this!” But she won’t listen.

And finally, the family’s all there and dinner is served and you’re not supposed to start unpleasant conversations at the Thanksgiving table – family rules – but you just can’t help yourself. So with everyone sitting at the table you say, “Mom, I love you, but you’ve got to get help and you have stop driving until you do!”

Gasps. Silence. Your mom’s face turns red.

Suddenly, your mom pounds her fists on the table. Glasses spill. She rises from her seat. She points a shaky finger at you and yells, “Have you no respect? How dare you dishonor that hero who died so we could have this dinner!”

Trump Despises Military Service

I get it. The military pay raise comment was a joke. But it’s not the first joke Trump made belittling military service members and Trump has repeatedly insulted military personnel and their families, including those who have lost loved ones in the line of duty. How often does Trump get to insult military personnel and their families – in jest or otherwise – before everyone understands that he has real contempt for those who sacrifice for our nation?

The man clearly thinks that real sacrifice is stupid and has no respect for anyone who does so.

Remember

I can go on. Others have, (see: https://www.cheatsheet.com/…/every-time-trump-has-disrespe…/) but it’s hard to even keep up.

I’ve lived through years of listening to people complain that Bill Clinton and Barack Obama, having never served, don’t respect our military. But I’ve never before seen someone who never served take jabs at service members. I’ve never before seen anyone publicly insult a Gold Star family. I’ve never before seen someone do as little for the military as Trump does, then lie about it, claiming that he’s done more than his predecessors.

We have a head of the Environmental Protection Agency who is dismantling environmental protections, a Secretary of Education who hates public schools, a Secretary of Treasury who failed to report $100 Million in assets due to an “oversight”. I supposed it’s only fitting to have a Commander in Chief who is disgusted by military service.

Get Suffolk To The Polls!

Voter suppression; gerrymandering; fake news; hacking. All of these are threats to our democracy.

But our biggest threat is people not registering to vote and voters not getting to the polls!

The Suffolk Democratic Committee is working with other local organizations to register voters during National Night Out and other events in and around Suffolk.

Help us out!

Call Michele at 757-934-2929 or use the Suffolk Democratic Committee’s Contact Form to let us know that you want to register voters and get people to the polls.

Thank you!

In Django, Effectively Allowing Addition and Removal of Related Models

I’m very new with Django and am happy to accept criticism or suggestions on better ways to do this.

The use case for what I’ve done is this: I’m working on a database to track membership for a small political committee. One of the things we’re interested in is the districts in which our members live. There are different types of districts that we want to track including voting precincts, municipal boroughs, state house districts, state senate districts, and U.S. congressional districts.

For creating or editing a person’s information, there should be a single select box for each type of district. But I want admins to be able to add and remove district types through the admin panel.

To make this work, I have four models: Person, District, DistrictType, and Residency. Residency is an intermediate model for Person and District, but I defined it as a class instead of letting Django create it.

Here is a very simplified version of my models:
Models.py

class DistrictType(models.Model):
    name = models.CharField('Name', max_length=30, help_text='The name of the type of district')

    def __str__(self):
        return self.name


class District(models.Model):
    name = models.CharField('Name', max_length=30, help_text='The name of the type of district')
    district_type = models.ForeignKey(DistrictType, on_delete=models.SET_NULL, null=True)

    def __str__(self):
        return self.name

class Person(models.Model):
    name=models.CharField('Name', max_length=30, help_text='The person's full name'

    def__str__(self):
        Return self.name

class Residency(models.Model):
    district = models.ForeignKey(District, on_delete=models.CASCADE, help_text='The district in which the person lives')
    person = models.ForeignKey(Person, on_delete=models.CASCADE, help_text='The person who lives in the district')

    def __str__(self):
        return self.district + ': ' + self.person

 

I want admin to be able to add and remove districts and district types.

admin.py

from .models import District, DistrictType

class DistrictAdmin(admin.ModelAdmin):
    list_display = ( "name", "district_type")
admin.site.register(District, DistrictAdmin)

class DistrictTypeAdmin(admin.ModelAdmin):
    list_display = ( "name")
admin.site.register(DistrictType, DistrictTypeAdmin)

 

With District and DistricType registered, admins can add and remove district types (and districts) as needed.

I want users to be able to add and edit people without using the admin panel, and I want the person form to have one select box for each type of district. Of course, I have permissions set to restrict who can add and edit people, but I’m not covering that here.

If, for example, I have four types of districts, I want four select boxes on the person form. Each of those select boxes represents a residency. So I have to define a residency form to be used as an inline model form.

forms.py

class PersonForm(ModelForm):
    class Meta:
        model = Person
        fields = (
            "name",
        )

class ResidencyForm(ModelForm):
    district_type_name = forms.CharField(required=False)
    class Meta:
        model = Residency
        fields = (
            "district",
        )

 

Note that district_type_name is not part of the residency model and won’t be used in the update or creation of the object. The reason it is there will be explained below.

The residency model has two fields, person and district, but only district is needed here because person will be taken care of by the formset factory.

views.py

class PersonCreate(CreateView):
    model = Person
    form_class=PersonForm

    district_type_all = DistrictType.objects.all()
    district_type_count = DistrictType.objects.count()

    ResidencyFormSet = inlineformset_factory(Person, Residency, form=ResidencyForm, extra=district_type_count, max_num=district_type_count, fields='__all__')

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)

        residencies = self.ResidencyFormSet( instance = self.object )
        for i in range( self.district_type_count):
            residencies.forms[i].fields['district'].queryset = District.objects.filter(district_type__id=self.district_type_all[i].id)
            residencies.forms[i].fields['district_type_name'].initial = self.district_type_all[i].name
            context['district_label_' + str(i)] = self.district_type_all[i].name
        context['residencies'] = residencies

        return context

    def form_valid(self, form):

        self.object = form.save()

        context = self.get_context_data()

        residencies = context['residencies']
        if residencies.is_valid():
            residencies.save()

        return super(PersonCreate, self).form_valid(form)

 

If you don’t understand inline formsets, I think Daniel Chen’s post will explain their use a lot better than the Django docs.

With the line

ResidencyFormSet = inlineformset_factory(Person, Residency, form=ResidencyForm, extra=district_type_count, max_num=district_type_count, fields='all')

, I created a set of inline forms. The first parameter, Person, defines the parent model. This is why I don’t need a person field in my form definition. The extra parameter defines how many inline forms to display. I want that number to match the amount of district types.

The max_num parameter ensures there will be no more forms displayed than the amount of district types. It’s not necessary in the creation view, although I included it here, but it is necessary in the update view. Without it, there would be four extra select boxes in addition to those that already have data from the previous update or creation.

At this point, I would have four identical inline forms, each with a select box that includes every district in the database. But I want to limit each select box to a certain district type. This is where I think I’m breaking new ground.

Here’s another look at get_context_data in views.py

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)

        residencies = self.ResidencyFormSet( instance = self.object )
        for i in range( self.district_type_count):
            residencies.forms[i].fields['district'].queryset = District.objects.filter(district_type__id=self.district_type_all[i].id)
            residencies.forms[i].fields['district_type_name'].initial = self.district_type_all[i].name
        context['residencies'] = residencies

        return context

 

In get_context_data, I go through each of the residency forms in the formset, and update the queryset for it’s select box. Now each select box is limited to districts of a certain district type.

Here’s where that extra district_type_name field comes in. The default label for the district field is “District”. But on the form, I want each label to be the name of the district type that the select box is limited to. So I populate the unbound field district_type_name with the name of the district type, and use that value as the label.

From person_form.html in my templates directory


    {% csrf_token %}
    <div class="section" >
        Name
        <div class="row" >
            <div class="label" >
                Full Name
            </div >
            <div class="fields" >
                <div class="field" >
                    {{ form.given_name }}
                </div >
            </div >
        </div >
    </div >

    {{ residencies.management_form }}
    <div class="section" >
        Districts
        {% for form in residencies.forms %}
            <div class="row" >
                <div class="label" >
                    {{ form.district_type_name.value }}
                </div >
                <div class="fields" >
                    <div class="field" >
                        {{ form.district }}
                    </div >
                </div >
            </div >
        {% endfor %}
    </div >

    

Here I used district_type_name.value as the label for each select box

Virginians: You mad yet?

After decades of grousing about service, family values, the rule of law, executive restraint, and the dignity of the Office of the President, Republicans elected a draft-dodging, sexually abusive philanderer who has no understanding of the Constitution, boasts about all his executive orders, and embarrasses the nation with his childish tweets and his reality show cabinet of hired and fired loudmouths.

Are you mad enough to do something about it yet?

I ask because the goon who now soils the world’s most dignified office has a minion poised to do the same to the highest office in Virginia.

You can stop it by voting. And when you vote, don’t stop at Governor. Because every Republican victory only encourages Republican hatred, lies, and embarrassing behavior.

Sure, a lot of Republicans are decent human beings. But what good is a decent Republican who doesn’t denounce the hatred and lies of their party’s leadership? What good is a decent Republican who supports the lie that smart immigration policy is the same as supporting vicious gangs? What good is a decent Republican who doesn’t stand up to the NRA as they distort the meaning of our Constitution to make money from the blood and fear of American citizens? What good is a decent Republican who will throw away federal funds for Medicaid expansion just to spite hard working Virginians who might benefit from it?

This is the year for real Virginians to show the wold that we’re smart enough to see the truth behind the lies and bring back some dignity to hour highest offices. This is the year we get to the polls and vote for Democrats up and down the ticket.