Skip to content

Instantly share code, notes, and snippets.

View lcruz's full-sized avatar

Luis Cruz lcruz

View GitHub Profile
@doctorpangloss
doctorpangloss / repetition_algorithm.ipynb
Last active November 23, 2023 19:13
Supermemo 2 Algorithm, Unobscured (Python 3)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lcruz
lcruz / gist:2595418
Created May 4, 2012 15:15
Group a list of objects (django model) by a foreign model
def group_by_foreign_model():
"""
Example of the model:
class MyModel(Model):
foreign = models.ForeignKey(MyForeignModel)
"""
result = MyModel.objects.all()