This file contains hidden or 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
| # Problem F at https://ep2012.europython.eu/pyddle | |
| # 50 chars | |
| import math;sum(map(int,str(math.factorial(1e3)))) |
This file contains hidden or 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
| class Release(models.Model): | |
| ... # a lot of fields | |
| tarball = models.FileField(blank=True) | |
| wheel = models.FileField(blank=True) | |
| checksum = models.FileField(blank=True) | |
| class ReleaseAdmin(admin.ModelAdmin): | |
| # What I want is for the fields tarball, wheel and checksum to be optional | |
| # on the model, but required in the admin form |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
This file contains hidden or 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
| Name,Pronouns,Location,Statement | |
| Andrew Miller,(he/him),"Cambridge, UK","Hi there, for those that haven’t come across me yet, I’m very active on the Discord, joining a couple of years ago, I serve as a moderator and generally helping out. I have also authored a Working Group proposal that is almost ready to go live, pending Board approval. Finally I organise the monthly Django Social in Cambridge. | |
| However perhaps what is most relevant to my nomination for the Steering Council are the blog posts I have written this year. They have been short & snappy where I have prodded and explained different aspects of using Django, the contributing process and other aspects of the community. | |
| I am nominating myself for the Steering Council to ensure that Django has a secure future. Personally I have used Django for the last 12 years and it has been integral to my software engineering career. The last two and half years have been the best in terms of getting involved in the community and has increased my passion for improv |
This file contains hidden or 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
| """ | |
| How to update JSONField based on the value of another field. | |
| For example: | |
| class MyModel(models.Model): | |
| name = models.CharField(...) | |
| data = models.JSONField() | |
| How to update the MyModel table to store the `name` field inside the `data` |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 1.
This file contains hidden or 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
| Abigail Gbadago,"Accra, Ghana","Hi, | |
| I am Abigail(Afi), a DSF member who has contributed to the Django Ecosystem for about four years. I have held the following positions in the community: | |
| Leadership council member for Black Python Devs (current) | |
| Open Source Program Manager for Black Python Devs - I am managing 39 of our community members make their first steps in open source (current) | |
| Programs Team member for DjangoCon US 2024 | |
| Contributed in organizing Django Girls Zanzibar (2023) ahead of the first DjangoCon Africa, co-organiser of Django Girls in Kwahu-Ghana (2019), and coach at Django Girls Ho-Ghana; 2018, 2024 and Zanzibar (2023) | |
| DjangoCon US Speaker 2023, you can watch my talk here: Strategies for Handling Conflicts and Rollbacks with Django |
This file contains hidden or 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
| from django.core.cache import BaseCache, CacheHandler | |
| from django.core.cache.backends.base import DEFAULT_TIMEOUT | |
| from django.core.exceptions import ImproperlyConfigured | |
| class TransitionCache(BaseCache): | |
| """ | |
| A cache backend that helps transitioning from one backend to another. | |
| To use it, set both 'NEW' and 'OLD'as keys in the backend's configuration |
This file contains hidden or 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
| <table> | |
| {% for client in clients %} | |
| ... | |
| <tr> | |
| ... | |
| <td> | |
| <select> | |
| {% for group in client.groups.all %}{# prefetched #} | |
| <option{% if group.pk in user_groups %} selected{% endif %}>{{group}}</option> | |
| {% endfor %} |
This file contains hidden or 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
| import django | |
| django.setup() | |
| from django.utils import translation | |
| from django.utils.dates import MONTHS | |
| def monthstr(i, lang): | |
| translation.activate(lang) | |
| return str(MONTHS[i]) |
This file contains hidden or 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
| # https://code.djangoproject.com/ticket/17209 | |
| import urlparse | |
| from django.conf import settings | |
| from django.core.urlresolvers import reverse_lazy | |
| from django.http import HttpResponseRedirect, QueryDict | |
| from django.utils.decorators import method_decorator | |
| from django.utils.http import base36_to_int | |
| from django.utils.translation import ugettext as _ | |
| from django.views import generic |
NewerOlder