Question: Suppose I have something like this in my models.py:

```
class A(models.Model):
  name = CharField(max_length=20)

class B(models.Model):
  a = models.ManyToManyField(A)

```

I want to get A which has more than one time mapped with B.

Answer: 
It should work, but remember you have to `@import bootstrap` first and then generate the `badge-*` classes...

```
@import "bootstrap";

@mixin badge-variant($bg) {
  color: $bg;
  background-color: transparent;
  border: 1px solid $bg;

  &[href] {
    @include hover-focus {
      background-color: $bg;
    }
  }
}

@each $color, $value in $theme-colors {
  .badge-#{$color} {
    @include badge-variant($value);
  }
}

```

Demo: <https://www.codeply.com/go/Iq1RJ96AmW>
How about overidding `.badge` class like this and have `border`.

[![enter image description here](https://i.stack.imgur.com/qqTmf.png)](https://i.stack.imgur.com/qqTmf.png)

**CSS**

```
.badge {
      border: 2px solid #ff0000
 }

```

**Sample HTML which contains badges,**

```
<div class="container mt-4">
        <div class="row">
          <div class="col-12">
            <h1>Example heading <span class="badge badge-secondary">New</span></h1>
      <h2>Example heading <span class="badge badge-secondary">New</span></h2>
      <h3>Example heading <span class="badge badge-secondary">New</span></h3>
      <h4>Example heading <span class="badge badge-secondary">New</span></h4>
      <h5>Example heading <span class="badge badge-secondary">New</span></h5>
      <h6>Example heading <span class="badge badge-secondary">New</span></h6>
          </div>
        </div>
  </div>

```

**An example,**

<https://codepen.io/anjanasilva/pen/MPmxJd>

I hope this helps. Cheers.