I have two models: Book and Reply
*the model Book*
class Book(models.Model):
"""
Model for books
"""
# other fields
replies = GenericRelation(Reply, related_query_name='books')
# managers
objects = models.Manager()
objects = BookManager.from_queryset(BookQuer
Thank you Simon,
This func expression what was I looking for. However, some more complex
queries with the date() function still confuse me.
For example the SQL query:
select count(distinct UniqueCallID), date(JoinTime) from Table group by
date(JoinTime);
I tried to write it as:
calls = Call
Hi Galil,
in this case you'll want to take a look at how `values()` and `annotate()`
interact with
each others[1] in regard to GROUP BY.
The following should do:
Call.objects.annotate(
joindate=Func(F('jointime'), function='DATE')
).values('joindate').annotate( # values before annotate() s
Hi dk.
If I understand well, you want to pass args from JS / HTML to python view ?
Are you try url(r'^run_delete(.*)', views.run_delete, name='run_delete') ?
Thanks
>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from th
Hi dk.
If I understand well, you want to pass arg of JS / HTML to python view ?
Are you try url(r'^run_delete(.*)', views.run_delete, name='run_delete') ?
Thanks
вторник, 31 мая 2016 г., 13:33:59 UTC+4 пользователь dk написал:
>
> this is the URS i get
>
> http://127.0.0.1:8000/my_app/run_delete
If you are getting syntax errors, it is best to post the relevant code
here, along with the Python stack trace. English is usually not good at
describing programming errors.
On Tuesday, 14 June 2016 23:56:02 UTC+2, Mc. Holid wrote:
>
> Dear All
>
> It seem this is the best starting guide for me,
def base(request):
j=Job.objects.all()
a=Ab.objects.all()
return render(request,'base.html',{'j':j, 'a':a})
def index(request):
base(request)
x=X.objects.all()
return render(request, 'index.html',{'x':x})
def list(request):
base(request)
z=Z.objects.all()
ret
Hi,
I made a reusable-app following the this tutorial :
https://docs.djangoproject.com/en/1.9/intro/reusable-apps/
The app works, but not the translation of the different messages that are
in the locale folder. When I change the LANGUAGE_CODE value in the
settings.py file, the django admin fol
Thanks for the update on the new Tango With Django. Everyone highly
recommends this tutorial so I'm excited to see its recently been updated :)
On Monday, June 13, 2016 at 12:51:07 PM UTC-6, gary719_list1 wrote:
>
> I stand corrected. There is a new Tango With Django tutorial out. It uses
> P
I want change image and delete this changed when i save this new. I write
delete method like below but it is not work, what is wrong?
models.py
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.core.validators import MaxValueValidator, MinValueValidator
Python/Django users,
Any Python and/or Django courses/materials to recommend?
I may be teaching a Python/Django class soon. My client may be
willing to jumpstart by buying existing course materials (lecture
slides, notes, homeworks, labs, reference links, any
Hello!!
We have a big Django application in production since a few years. We want
to refactor it, but before that, we want to study the real status about our
code. We want to do static and dynamics analisys to discover: Errors,
duplicities, dead code, unused features...
We have found some tool
Just like this. Unless you have a specific use case you forgot to share in
your mail.
Views are mere functions that get called with a request az a parameter. You
shouldn’t treat them as special/holy/uncallable.
Best,
Gergely
On Jun 15, 2016 19:56, "hossein" wrote:
> def base(request):
> j=J
Using Django 1.9.7.
I have the following class:
class AddView(LoginRequiredMixin, CreateView):
template_name = "entry.html"
model = Property
form_class = AddPropertyForm
success_url = "/buy/"
login_url = '/account/login/'
def dispatch(self, request, *args, **kwargs):
Try swapping class order.
Sent from my iPhone
> On Jun 15, 2016, at 6:55 PM, Lee Hinde wrote:
>
> Using Django 1.9.7.
> I have the following class:
> class AddView(LoginRequiredMixin, CreateView):
> template_name = "entry.html"
> model = Property
> form_class = AddPropertyForm
>
More Explain Please
On Thursday, June 16, 2016 at 3:13:38 AM UTC+4:30, Gergely Polonkai wrote:
>
> Just like this. Unless you have a specific use case you forgot to share in
> your mail.
>
> Views are mere functions that get called with a request az a parameter.
> You shouldn’t treat them as spe
I tried to downloan the tutorial from the given link /
media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf
It stil using django version 1.5.4
On Wed, Jun 15, 2016 at 10:44 PM, Shaylee Hansen <
shan...@gcommercesolutions.com> wrote:
> Thanks for the update on the new Tango Wi
Actually it's you. Please see inline:
On Jun 15, 2016 11:56 PM, "Lee Hinde" wrote:
>
> Using Django 1.9.7.
>
> I have the following class:
>
> class AddView(LoginRequiredMixin, CreateView):
> template_name = "entry.html"
> model = Property
> form_class = AddPropertyForm
> success_
18 matches
Mail list logo