Skip to content

Instantly share code, notes, and snippets.

@johannestaas
johannestaas / _namerator.py
Last active July 18, 2017 15:59
Namerator - Name generator PoC based on text patterns
'''
namerator
=========
Name generator, by generating characters based on frequencies of letter patterns
Usage:
$ python namerator.py -n 5 elf_names.txt
egil-gonamilin
taedhorilie
@goldhand
goldhand / Django + Ajax dynamic forms .py
Last active September 29, 2023 06:32
Django form with Ajax. A simple Task model that can be updated using a CBV with an AJAX mixin. The view sends post data with ajax then updates the view with a callback to a DetailView with a json mixin.There is an abstract CBV, AjaxableResponseMixin, based on the example form django docs, that is subclassed in the TaskUpdateView CBV. TaskUpdateV…
#models.py
class Task(models.Model):
title = models.CharField(max_length=255)
description = models.TextField()
def __unicode__(self):
return self.title