Skip to content

Instantly share code, notes, and snippets.

View asermax's full-sized avatar

Agustín Carrasco asermax

View GitHub Profile
// ==UserScript==
// @name Animebytes yen per x
// @description adds yen per day/week/month and raw upload/download values to your AB profile page
// @include *animebyt.es/user.php?id=*
// @include *animebytes.tv/user.php?id=*
// @icon http://animebytes.tv/favicon.ico
// ==/UserScript==
function formatInteger(intStr){
intStr += '';
// ==UserScript==
// @name Animebytes yen per x
// @description adds yen per day/week/month and raw upload/download values to your AB profile page
// @include *animebyt.es/user.php?id=*
// @include *animebytes.tv/user.php?id=*
// @icon http://animebytes.tv/favicon.ico
// ==/UserScript==
function formatInteger(intStr){
intStr += '';
@asermax
asermax / forms.py
Last active December 22, 2015 04:38
Related selects widget for Django
from django import forms
from your_app import widgets, models
class YourModelModelForm(forms.ModelForm):
class Meta:
model = models.YourModel
widgets = {
'your_field': widgets.RelatedModelSelect(
[models.GeneralModel, models.SpecificModel] # order is important here, the model that defines