hello
i have a birth date filed in my model this:
birth_date = models.DateField
(blank=True,null=True)
my forms.py i have this:
class ProfileForm(ModelForm):
birth_date= forms.DateField(widget=forms.SelectDateWidget)
class Meta:
model =
Where would I put that code? Is there a way to do it when the Admin form is
initialized?
On Monday, April 24, 2017 at 5:31:18 PM UTC-5, Todor Velichkov wrote:
>
> I think a simple redirect can fix your problem.
>
> Something like this:
>
> if 'lang' not in request.GET:
> q = request.GET.copy(
I think a simple redirect can fix your problem.
Something like this:
if 'lang' not in request.GET:
q = request.GET.copy()
q.setdefault('lang', 'en')
return redirect('%s?%s' % (request.path, q.urlencode()))
On Monday, April 24, 2017 at 7:12:18 PM UTC+3, Nate Granatir wrote:
>
> In
In my app I have admin filters for a field called "language" - language is
a field in several of my models - and I've created them custom, inheriting
from SimpleListFilter, so that I can apply a default of English when none
has yet been specified. This works almost perfectly - the only problem i
I'd avoid a more complex tool like Eclipse when starting out - and try
using a simple text editor like Atom or Sublime Text; that way you get a
much more "hands on" understanding of Django.
(Also - maybe don't MySQL when starting out & just stick to SQLite - its
fine for learning purposes)
On
The commit event handler is to commit a transaction, the on_commit event is
for running a function when the commit is done. That is my intention, but
maybe there is something I don't see.
I want to execute a celery task, foo.delay(...), when the save of Model is
finished. That way if I modify M
I'm not too familiar with Celery, but I think that for loop continuously keeps changing transaction's commit event handler. Maybe you are looking for something like transaction.commit instead of on_commit?
On Apr 24, 2017 2:37 PM, Emilio Jimenez Canalejo wrote:Hi, I've been looking for some time a
Hi, I've been looking for some time around the internet a problem I have,
maybe I'm just dull from all the searching and the answer is pretty
obvious, but I can't find it.
For example, I have code like this:
@app.task
def foo(idx):
print("This is iteration {}".format(idx))
def save_model(se
8 matches
Mail list logo