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 __future__ import annotations | |
import random | |
from datetime import datetime | |
from django.contrib.auth import get_user_model | |
from django.utils import timezone | |
from django.utils.translation import gettext as _ | |
from pydantic import BaseModel |
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 InlineFormView(): | |
formsets = [] | |
def get_formsets(self): | |
if not self.formsets: | |
raise ValueError('InlineFormView needs a "formsets" property.') | |
return self.formsets | |
def get_context_data(self, **kwargs): | |
data = super(InlineFormView, self).get_context_data(**kwargs) |
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
Verifying that +gabrielfgularte is my blockchain ID. https://onename.com/gabrielfgularte |
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
// When using angular-translate it's impossible to make two-way data binding translations yet, | |
// and this sometimes can be a headache. So I've developed this directive to save some time. | |
// The view goes like this: <TAG data-bind-translate="scopeObjToTranslate.item.text"></TAG>. | |
angular.module('myApp', ['pascalprecht.translate']).directive('bindTranslate', [ | |
'$translate', | |
'$parse', | |
function($translate, $parse) { |