Re: 'WSGIRequest' object is not callable error generate

2018-01-19 Thread Costja Covtushenko
Hi,

As suggested Etienne you misspelled `render` method.
Please find more information on that 
 
documentation page.

Regards,
Constantine C.

> On Jan 19, 2018, at 2:47 PM, Etienne Robillard  wrote:
> 
> 
> 
> Le 2018-01-19 à 13:53, Amit Kadivar a écrit :
>> 
>> 
>> return request(request,'signup.html',{'form':form})
> 
> That line looks incorrect to me. You need to use render_response or a similar 
> function... I don't remember the exact function name, however.
> 
> Cheers,
> 
> Etienne 
> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users+unsubscr...@googlegroups.com 
>> .
>> To post to this group, send email to django-users@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/9a822b59-f3cb-4024-955a-11c8e9ca8a9e%40googlegroups.com
>>  
>> .
>> For more options, visit https://groups.google.com/d/optout 
>> .
> 
> -- 
> Etienne Robillard
> tkad...@yandex.com 
> https://www.isotopesoftware.ca/ 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to django-users@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/070df736-c935-4b3c-2fd4-20e05c4c6631%40yandex.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/A8FDED7A-E009-4EBF-B0CD-388563D7EF12%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need to create an edit box connected to one table field

2018-01-19 Thread Costja Covtushenko
Hi Eileen,

Can you please elaborate a little bit?
Do you use Form? Can you provide its code?

Also sorry but it is not clear what are you trying to achieve with those value?
Is it for searching data in DB?

Regards,
Constantine C.

> On Jan 19, 2018, at 5:08 PM, eil...@themaii.org wrote:
> 
> handicapped

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3E238B5D-ED05-42EC-B451-98133471DB3E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Need to create an edit box connected to one table field

2018-01-19 Thread eileen


I need to create an edit box called handicapped with three drop down 
options on the display:
  0 - none
  1 - Mental
  2 - Phyiscal

and connect it to the handicapped field init(11) in the family database

I know I have to do something like:

if form['handicapped'].data == 1 or 2:
q = 
context['child_filter'].filter(Q(handicapped=handicapped_dict[request.POST['handicapped']]))

# start of output using search parameters

if q.count() > 1:
  search_message = "There are %s children that match your 
selection of %s"  %  (q.count(), request.POST['gender'])
else:
  search_message = "There is 1 child that matches your 
selection of %s"  %  (request.POST['gender'])

if q.count() > 1:
   search_message = ", age: %s"  %  (request.POST['age'])
else:
   search_message = ", age: %s"  % (request.POST['age'])

if form.data['handicapped'] is 'Physical' or 'Mental':
   if q.count() > 1:
  search_message = ", is %s handicapped" % 
 (request.POST['handicapped'])
   elif q.count() == 1:
  search_message = ", is %s handicapped" % 
(request.POST['handicapped'])
else:
search_message = ", are %s handicapped" % 
(request.POST['handicapped'])

but it doesn't _work at all_.

The database is defined all right, I should say.

I get lots of different types of errors - sorry I can't include them now, 
but definitely not week if the problem is still outstanding.

-Eileen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/538b8651-fcf9-4310-abe6-baae7d7b1f56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 'WSGIRequest' object is not callable error generate

2018-01-19 Thread Etienne Robillard



Le 2018-01-19 à 13:53, Amit Kadivar a écrit :



return request(request,'signup.html',{'form':form})


That line looks incorrect to me. You need to use render_response or a 
similar function... I don't remember the exact function name, however.


Cheers,

Etienne


--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9a822b59-f3cb-4024-955a-11c8e9ca8a9e%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/070df736-c935-4b3c-2fd4-20e05c4c6631%40yandex.com.
For more options, visit https://groups.google.com/d/optout.


'WSGIRequest' object is not callable error generate

2018-01-19 Thread Amit Kadivar
Hello..

I am making a signup page in django 2.0. generate the error " 'WSGIRequest' 
object is not callable ".
please give me a solution for that .
error show in following line 

return request(request,'signup.html',{'form':form})

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9a822b59-f3cb-4024-955a-11c8e9ca8a9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Filter Json boolean data

2018-01-19 Thread tango ward
That works. Silly me.

Thank you Florian.

On Fri, Jan 19, 2018 at 7:32 PM, Florian Schweikert 
wrote:

> Hi,
>
> On 19/01/18 11:50, tango ward wrote:
> > # Check who the winner of the match
> > if data['radiant_win'] == 'False':
>
> You are comparing a boolean with the *string* 'False', remove the ' and
> try again.
>
> > j_data['Winner'] = data['dire_name']
> > else:
> > j_data['Winner'] = data['radiant_name']
> >
> > # Put the data in our game_data list
> > game_data.append(j_data)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/28f8e57a-2857-b5dc-c987-d4f378bb3247%40ist-total.org.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA6wQL%2BqyJ6CtHDOqcHn7N%2B7F0w1auFEEDwoXnTBJKcNHwNPMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: unique_together does not work in django 2.0

2018-01-19 Thread James Bennett
You've indented the 'Meta' declaration too much, and Python thinks it's
part of the '__str__()' method of your class.

Un-indent it one level.

On Thu, Jan 18, 2018 at 4:28 PM, FernandoJMM 
wrote:

> Hello,
> I have the following class:
>
> ==
> class Silo(models.Model):
> nave = models.ForeignKey(Nave, on_delete=models.CASCADE)
> codSil = models.CharField(
> 'Código Silo', db_index=True, max_length=2, default='01')
> notas = models.TextField(null=True, blank=True)
>
> def __str__(self):
> return "%s %s" % (self.nave, self.codSil)
>
> class Meta:
> order_with_respect_to = 'nave'
> unique_together = ('nave', 'codSil')
> 
>
> But the option unique_together does not work because duplicate values
> ​​exist in the SQLite database for nave and codSil.
>
> To solve it, I have to create the index nave + codSil by hand in the
> SQLite database ???
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/555b1903-b6f5-4af1-b7a2-a7921d1fdbac%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAL13Cg8xH9Js57oBD%2BvJNdxucrimyhvYV2-jYV3mcNLFiYVczw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: unique_together does not work in django 2.0

2018-01-19 Thread FernandoJMM

Hello, Problem solved. 
For it to work I have to put the META class between the silo class and the 
method. Thank you

El viernes, 19 de enero de 2018, 12:53:28 (UTC+1), Jason escribió:
>
> To be clear, you started with an empty database and the duplicate values 
> exist after adding data?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d385d85a-c87f-4742-8c75-f430048f7554%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: emulate desktop multi-windows

2018-01-19 Thread johnf
Thank you very much - I was about to check out EXTjs along with 
DojotoolKit today.


It looks like I might be able to get this done using web tech.

Johnf


On 01/19/2018 02:42 AM, Jani Tiainen wrote:


Hi,

Also Dojotoolkit has windows (or actually Dijit does which is part of 
Dojotoolkit):


https://dojotoolkit.org/reference-guide/1.10/dojox/layout/FloatingPane.html

To my knowledge also Kendo UI does have such a window you're looking for.

On 19.1.2018 0.10, johnf wrote:


I believe I understand what you are saying.  But I was hoping that 
Django offered the javascript framework that allowed multi-windows.  
To get what I want I will have to use a javascript framework - I 
understand.  But that said, I have been researching several of the 
javascript frameworks and they do in fact allow new tabs (using 
chrome).  Example: google mail will allow multi-pages (actually tabs) 
of contacts just with multi clicks on the GMAIL dropdown.  But that 
wasn't what I was hoping for - I want individual windows/forms that I 
can resize, move, Max, Min, etc... So far the only thing I have found 
was the electron  app I spoke about earlier.  The electron framework 
allowed windows that can be resized, moved about the screen, and 
closed.  I am still researching but so far only Electron.  BTW the 
Electron is really a desktop app using web tools (css, html, 
javascript, and nodejs).  I'm guessing (mostly from your emails) that 
there are javascript frameworks that will allow what I looking for - 
I  just haven't found it YET!


Johnf


On 01/18/2018 11:12 AM, Andréas Kühne wrote:

No John,

I don't think you understand what we are saying :-)

Like I said earlier - Django is a HTML framework - like ALL HTML 
framework, it renders the pages you are seeing on the backend and 
presents the information to the user. That is per design in the HTML 
world. You click on a link and then the server renders a new page 
and so on. There is no way to add "windows" in any other way than to 
open a new browser. That is the way HTML works.


If you want to add a fancy single page application (which  is what 
you are suggesting) then the only way to do so is to use a 
Javascript framework of some kind. What that does is to add the 
ability to do windows and the like - just in the way you want to do 
it - and that is still within the "web UI wold". If you look at 
things like the google cloud engine interface or gmail or the amazon 
AWS interface, that is all done on the web, with a web UI. However 
all of those pages REQUIRE javascript to function.


So it is often requested and I am currently working on a single page 
application that uses django for the backend, but HTML cannot render 
the single page application - that is done in a javascript 
framework. So web UI is completely on par with a desktop application 
but it requires more components that you are willing to use :-)


Regards,

Andréas

2018-01-18 19:26 GMT+01:00 johnf >:


The reason I wanted Django was to insure that the data is valid
(using python).   When they enter the data and the submit button
is clicked I want to be able to modify the response using python.

So what I'm hearing from the list - is that in general - people
are not using the Django template system.  Is that right?

I have been doing a little research and have discovered a couple
of javascript tools that allow multi -
windows/forms/dialogs/frames.   But then - like you said - I'm
replacing the Django template system.

It seems that web UI is still not up to the desktop abilities. 
That's not good.  BTW I was looking at Electron and discovered
that it can easily match the desktop multi-window and it's using
web tech.  So I'm guessing it is possible but not often requested.

Johnf


On 01/18/2018 09:48 AM, Andréas Kühne wrote:

Hi,

I think you are not thinking this completely through correctly.

Django is a framework used to generate HTML pages. HTML pages
render one page at a time in one webbrowser window. That is the
way HTML works.

You can via javascript do some funky things, like Single page
applications - but then most of the templating engine in django
isn't used. You could create templates on the backend and send
them via ajax to the frontend but that is mainly used for
rendering partial pages and not for complete pages. Also, it
would be really cumbersome to write the code.

If you already have a REST backend, why do you need django at
all? Django isn't the best framework for getting information
from a REST API and then publishing the information. You really
should be looking into running a single page application in
that case...

Django can be used to create a REST backend for the single page
application however.

Regards,

Andréas

2018-01-18 17:25 GMT+01:00 johnf 

Re: emulate desktop multi-windows

2018-01-19 Thread Jason
In other words, Django has the ability to generate HTML from the context 
you provide it, which is then rendered by the browser.  It doesn't have the 
ability to manipulate as you want because you need to set up a method for 
the browser to communicate back to the server.

That's what people here are saying.  You have the ability to handle 
requests, process data and return responses with django.  Now you need to 
use browser-side development in order to have your users *consume* and 
*interact* with your Django application.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/331d45f2-37ab-4a90-a3f6-65bc171b3a99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple websites on same host using Apache as Webserver.

2018-01-19 Thread Jason
When asking for help regarding code issues, configuration and such, 
excluding your code and settings, configuration and others means that no 
one can help.

In the future, please remember to include samples for what is causing your 
problem, because unfortunately no one has mind-reading ability.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2d89c496-b024-4552-8ce4-c65d643dc359%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: emulate desktop multi-windows

2018-01-19 Thread Andréas Kühne
HI John,

Django is a HTML framework - you would need to add the javascript part
yourself - that's just the way it works.

There are several different ways of doing what you want, here are a couple
of examples:
http://www.qooxdoo.org/current/widgetbrowser/
https://www.primefaces.org/showcase/ui/overlay/dialog/basic.xhtml

I wouldn't use qooxdoo, but the dialogs are nice :-)

It's really just a matter of searching google

Look into which JS framework you want to use and then the ui will solve
itself.

Regards,

Andréas

2018-01-18 23:10 GMT+01:00 johnf :

> I believe I understand what you are saying.  But I was hoping that Django
> offered the javascript framework that allowed multi-windows.  To get what I
> want I will have to use a javascript framework - I understand.  But that
> said, I have been researching several of the javascript frameworks and they
> do in fact allow new tabs (using chrome).  Example: google mail will allow
> multi-pages (actually tabs) of contacts just with multi clicks on the GMAIL
> dropdown.  But that wasn't what I was hoping for - I want individual
> windows/forms that I can resize, move, Max, Min, etc... So far the only
> thing I have found was the electron  app I spoke about earlier.  The
> electron framework allowed windows that can be resized, moved about the
> screen, and closed.  I am still researching but so far only Electron.  BTW
> the Electron is really a desktop app using web tools (css, html,
> javascript, and nodejs).  I'm guessing (mostly from your emails) that there
> are javascript frameworks that will allow what I looking for - I  just
> haven't found it YET!
>
> Johnf
>
> On 01/18/2018 11:12 AM, Andréas Kühne wrote:
>
> No John,
>
> I don't think you understand what we are saying :-)
>
> Like I said earlier - Django is a HTML framework - like ALL HTML
> framework, it renders the pages you are seeing on the backend and presents
> the information to the user. That is per design in the HTML world. You
> click on a link and then the server renders a new page and so on. There is
> no way to add "windows" in any other way than to open a new browser. That
> is the way HTML works.
>
> If you want to add a fancy single page application (which  is what you are
> suggesting) then the only way to do so is to use a Javascript framework of
> some kind. What that does is to add the ability to do windows and the like
> - just in the way you want to do it - and that is still within the "web UI
> wold". If you look at things like the google cloud engine interface or
> gmail or the amazon AWS interface, that is all done on the web, with a web
> UI. However all of those pages REQUIRE javascript to function.
>
> So it is often requested and I am currently working on a single page
> application that uses django for the backend, but HTML cannot render the
> single page application - that is done in a javascript framework. So web UI
> is completely on par with a desktop application but it requires more
> components that you are willing to use :-)
>
> Regards,
>
> Andréas
>
> 2018-01-18 19:26 GMT+01:00 johnf :
>
>> The reason I wanted Django was to insure that the data is valid (using
>> python).   When they enter the data and the submit button is clicked I want
>> to be able to modify the response using python.
>>
>> So what I'm hearing from the list - is that in general - people are not
>> using the Django template system.  Is that right?
>>
>> I have been doing a little research and have discovered a couple of
>> javascript tools that allow multi - windows/forms/dialogs/frames.   But
>> then - like you said - I'm replacing the Django template system.
>>
>> It seems that web UI is still not up to the desktop abilities.  That's
>> not good.  BTW I was looking at Electron and discovered that it can easily
>> match the desktop multi-window and it's using web tech.  So I'm guessing it
>> is possible but not often requested.
>>
>> Johnf
>>
>> On 01/18/2018 09:48 AM, Andréas Kühne wrote:
>>
>> Hi,
>>
>> I think you are not thinking this completely through correctly.
>>
>> Django is a framework used to generate HTML pages. HTML pages render one
>> page at a time in one webbrowser window. That is the way HTML works.
>>
>> You can via javascript do some funky things, like Single page
>> applications - but then most of the templating engine in django isn't used.
>> You could create templates on the backend and send them via ajax to the
>> frontend but that is mainly used for rendering partial pages and not for
>> complete pages. Also, it would be really cumbersome to write the code.
>>
>> If you already have a REST backend, why do you need django at all? Django
>> isn't the best framework for getting information from a REST API and then
>> publishing the information. You really should be looking into running a
>> single page application in that case...
>>
>> Django can be used to create a REST backend for the single page
>> application however.

Re: 2 decimals, always

2018-01-19 Thread Kasper Laudrup

Hi Carmelo,

On 2018-01-19 13:24, Carmelo J. Morales Muñoz wrote:

hello!

I don´t know how solve this... I need django show always float numbers 
in this format:


1234.56

actually use 1 decimal only, example:   1234,1

I need 1234,10



You don't write anything about which context you're talking about, but 
assuming you're talking about the Django templating system, you should 
have a look at this:


https://docs.djangoproject.com/en/2.0/ref/templates/builtins/#floatformat

Cheers,

Kasper

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8e1ecdf8-999f-7c60-f61b-4b35e081c9bf%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


2 decimals, always

2018-01-19 Thread Carmelo J . Morales Muñoz
hello!

I don´t know how solve this... I need django show always float numbers in 
this format:

1234.56 

actually use 1 decimal only, example:   1234,1

I need 1234,10

thanks for your help

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4448d0ec-4796-4d88-9b09-0f17a4f3870f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple websites on same host using Apache as Webserver.

2018-01-19 Thread Carmelo J . Morales Muñoz
I have same problen you, i have use gunicorn but I don´t know how can I 
solve it

El miércoles, 17 de enero de 2018, 13:09:16 (UTC+1), Mahesh Vernekar 
escribió:
>
> Can someone provide help on configuring multiple websites on the same host.
> I have tried the appropriate configuration.
> But the new website created opens in the folder of the old website.
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c45b6841-0d91-4ddd-8567-018c37db348c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: HTML video seek problem in django

2018-01-19 Thread Jason
After a bit more digging, there's a thread on the django-developers google 
group:

https://groups.google.com/forum/#!searchin/django-developers/http$20range$20header%7Csort:date/django-developers/NZ1qTkZ6vok/0T7YXSdrizgJ

Apparently that patch developer never followed up.  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cb589b60-fa35-4c4a-97a1-b855650e5e9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: unique_together does not work in django 2.0

2018-01-19 Thread Jason
To be clear, you started with an empty database and the duplicate values 
exist after adding data?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/529e8c4d-bedb-40a4-ac42-c7ad42e5d6ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: HTML video seek problem in django

2018-01-19 Thread Jason
Nice find!  Wonder why that author never made a PR to the django project?  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3c482d75-69e9-40d9-b9df-ff990e6bebaa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Filter Json boolean data

2018-01-19 Thread Florian Schweikert
Hi,

On 19/01/18 11:50, tango ward wrote:
>     # Check who the winner of the match
>     if data['radiant_win'] == 'False':

You are comparing a boolean with the *string* 'False', remove the ' and
try again.

>     j_data['Winner'] = data['dire_name']
>     else:
>     j_data['Winner'] = data['radiant_name']
> 
>     # Put the data in our game_data list
>     game_data.append(j_data)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/28f8e57a-2857-b5dc-c987-d4f378bb3247%40ist-total.org.
For more options, visit https://groups.google.com/d/optout.


Filter Json boolean data

2018-01-19 Thread tango ward
Hi guys,


I want to get the correct data if if key == false from a json data. My if
else condition seems to be working however the data is inconsistent. Here's
my code:


class DotaMatches(TemplateView):
template_name = 'matches/dota_matches.html'

def get(self, request, *args, **kwargs):
# Get the URL of the API using requests module
url = requests.get('https://api.opendota.com/api/proMatches')
# Decode the data
json_data = url.json()

# List that will contain dictionaries
game_data = []

for data in json_data:
# Will contain the values from the dictionary data of json_data
j_data = {}
j_data['League'] = data['league_name']
j_data['Radiant'] = data['radiant_name']
j_data['Dire'] = data['dire_name']
j_data['Duration'] = str(timedelta(seconds=data['duration']))
j_data['Finished'] = timeago.format(datetime.now() -
datetime.fromtimestamp(data['start_time']))

# Check who the winner of the match
if data['radiant_win'] == 'False':
j_data['Winner'] = data['dire_name']
else:
j_data['Winner'] = data['radiant_name']

# Put the data in our game_data list
game_data.append(j_data)

return render(request, self.template_name, {'game_data': game_data})


Not sure if there's something that I need to do first before running the if
- else condition.



Regards,
Jarvis

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA6wQLLfU_EsWf4AmNMHcraBkdqQgKSmPsBoMzfFfjfxu%2BYZZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.