Skip to content

Instantly share code, notes, and snippets.

@greenkey
greenkey / Day_31_Kids_will_be_all_right.md
Last active January 24, 2023 09:58
Day 31: Kids will be all right

Day 31: Kids will be all right

Babbo Natale vuole assicurarsi che ogni regalo possa essere dato ad un bambino.

Ogni regalo ha delle caratteristiche che lo rendono adatto per alcune classi di bambini.

Ad esempio un regalo potrebbe essere adatto ai bambini che amano l’avventura, oppure potrebbe essere adatto solo per bambini con un’eta’ tra 6 e 10 anni.

Le caratteristiche che prende in considerazione Babbo Natale sono:

@greenkey
greenkey / subform.py
Last active January 27, 2023 08:31
how to change one attribute of a Django form field
from django import forms
class MyGenericForm(forms.Form):
valid_from = forms.DateField(
required=False,
label='Validity Start',
help_text="The first date that this rate is valid.",
widget=forms.DateInput(attrs={"placeholder": "YYYY-MM-DD"}, format="%Y-%m-%d"),
input_formats=["%Y-%m-%d"],
)
@greenkey
greenkey / testing_issue.py
Last active March 21, 2024 16:55
An issue I just discovered
import itertools
import pytest
def sum(a, b):
return a + b
def minimum(*numbers):