Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Zac Miller jzmiller1

🎯
Focusing
  • Gainesville, GA
Block or report user

Report or block jzmiller1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jzmiller1
jzmiller1 / remerge.py
Created Jun 29, 2016 — forked from mahmoud/remerge.py
Recursively merging dictionaries with boltons.iterutils.remap. Useful for @hynek's configs. https://twitter.com/hynek/status/696720593002041345
View remerge.py
"""
This is an extension of the technique first detailed here:
http://sedimental.org/remap.html#add_common_keys
In short, it calls remap on each container, back to front, using the accumulating
previous values as the default for the current iteration.
"""
View example_code.py
class UUIDIdMixin(models.Model):
class Meta:
abstract = True
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
class Body(UUIDIdMixin):
name = models.CharField(max_length=140)
description = models.CharField(max_length=280)
You can’t perform that action at this time.