This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
find foo(x, y, z) == 25 | |
""" | |
import random | |
from itertools import chain | |
MAX_GENERATIONS = 10_000 | |
GEN_POOL_SIZE = 1_000 | |
BEST_N = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
kuba = Human(name='Kuba', character='x') | |
# this does not work | |
# TypeError: Can't instantiate abstract class Player with abstract methods choose_position | |
imported_player = Player.from_file('some_player') | |
players = [kuba, imported_player] | |
board = Board(size=20, empty_character='-') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@admin.register(Role) | |
class RoleAdmin(admin.ModelAdmin): | |
filter_horizontal = [ | |
'permission_groups', | |
'permissions', | |
] | |
list_display = [ | |
'name', | |
'perm_groups_str', | |
'perm_str', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
More details on the implementation and usage can be found at | |
https://www.pyscoop.com/django-jsonfield-attributes-in-admin-filter/ | |
""" | |
from django.contrib import admin | |
from django.core.exceptions import ImproperlyConfigured | |
class JSONFieldFilter(admin.SimpleListFilter): |