Key error for error messages in case the check on unique fails.

2019-01-30 Thread 'Odile Lambert' via Django users

  
  
Hello
I have a field in my model which has unique = True.
If I specify an error message with a reference to the value of
  the field, Django crashes with Key error.
Yet this works for other error_messages. How wan I solve this?
Here is the code and the trace back
 https://dpaste.de/t5X8#
Is this a bug in admin?
I thank you in advance for your help.
  Piscvau




 



  




-- 
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/7fb7b0a0-7f36-7055-e751-16dbd2122fee%40laposte.net.
For more options, visit https://groups.google.com/d/optout.


Re: Get very last object of database

2019-01-30 Thread Stéphane Manguette
Hi Matthew,

Thanks for your prompt answer; I will keep it in mind for terminology, 
totally get it, Thanks !

Stéphane

Le mercredi 30 janvier 2019 23:08:08 UTC+1, Matthew Pava a écrit :
>
> You can try Mydb.objects.last()
>
> You can also try reversing the order and using first: 
>  Mydb.objects.order_by(‘-pk’).first()
>
>  
>
> And for some terminology clarification, a database consists of tables.  In 
> Django, a model maps to a table, not a database.  A table has fields; a 
> database has tables but not fields.
>
>  
>
> *From:* django...@googlegroups.com  [mailto:
> django...@googlegroups.com ] *On Behalf Of *Stéphane 
> Manguette
> *Sent:* Wednesday, January 30, 2019 4:02 PM
> *To:* Django users
> *Subject:* Get very last object of database
>
>  
>
> Hello guys, 
>
>  
>
> My issue is pretty simple. I want to get the very last record of my 
> database (which is populated with thousands of entries)
>
>  
>
> So far ->very easy. But I want to make sure that the access to the 
> database is as light as possible. Don't want django to parse everything in 
> my database.
>
>  
>
> Kindly note that my DB has Primary key field.
>
>  
>
> I tried 
>
> Mydb.objects.all()[:1]
>
> Mydb.objects.all()[1:]
>
>  
>
>  
>
> but both return the first filed instead of the last one.
>
>  
>
> Thanks for your help
>
>  
>
> Stephane
>
> -- 
> 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...@googlegroups.com .
> To post to this group, send email to djang...@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/32533a94-d27f-4091-9910-6644cd11ea49%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/709b4ec9-585d-480d-8c26-a0b05b5d58b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Get very last object of database

2019-01-30 Thread Matthew Pava
You can try Mydb.objects.last()
You can also try reversing the order and using first:  
Mydb.objects.order_by(‘-pk’).first()

And for some terminology clarification, a database consists of tables.  In 
Django, a model maps to a table, not a database.  A table has fields; a 
database has tables but not fields.

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Stéphane Manguette
Sent: Wednesday, January 30, 2019 4:02 PM
To: Django users
Subject: Get very last object of database

Hello guys,

My issue is pretty simple. I want to get the very last record of my database 
(which is populated with thousands of entries)

So far ->very easy. But I want to make sure that the access to the database is 
as light as possible. Don't want django to parse everything in my database.

Kindly note that my DB has Primary key field.

I tried
Mydb.objects.all()[:1]

Mydb.objects.all()[1:]


but both return the first filed instead of the last one.

Thanks for your help

Stephane
--
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/32533a94-d27f-4091-9910-6644cd11ea49%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/cacd493cb77144439571ce4f29aa3514%40iss2.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Get very last object of database

2019-01-30 Thread Stéphane Manguette
Hello guys, 

My issue is pretty simple. I want to get the very last record of my 
database (which is populated with thousands of entries)

So far ->very easy. But I want to make sure that the access to the database 
is as light as possible. Don't want django to parse everything in my 
database.

Kindly note that my DB has Primary key field.

I tried 
Mydb.objects.all()[:1]

Mydb.objects.all()[1:]



but both return the first filed instead of the last one.

Thanks for your help

Stephane

-- 
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/32533a94-d27f-4091-9910-6644cd11ea49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Begginner

2019-01-30 Thread Segun Gesture
You have to create a virtual environment, install django and start ur app

On Wed, Jan 30, 2019, 1:24 PM Frank john thompson  how do i build webside on python using django?
>
> --
> 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/a9b4d604-f34e-494e-a156-8170aa1e9a75%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/CA%2B%3DkChmfWaJ9t7t0DCEgk5ZC5tB1RBPqu4Z_%3D2Kybancf0do5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: any help thanks .

2019-01-30 Thread Segun Gesture
Where are u having problem in your project

On Wed, Jan 30, 2019, 8:51 PM Mohamed Hashi  i have a problem in my django
> i allready did start the project
> i would to get help and discuss about things
> any ready for helping me
> this is my whatsapp number
> 00918686910983
> 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/CAOiYw3vO8LwRzrnDbvo4xspStLKiJVjDmBbeqVw0XDpqVinuyg%40mail.gmail.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/CA%2B%3DkCh%3DTyFGGC49YC9ihSotvDJsK_d_cVz0ALrfY%2BB%2BPvg7kYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


any help thanks .

2019-01-30 Thread Mohamed Hashi
i have a problem in my django
i allready did start the project
i would to get help and discuss about things
any ready for helping me
this is my whatsapp number
00918686910983
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/CAOiYw3vO8LwRzrnDbvo4xspStLKiJVjDmBbeqVw0XDpqVinuyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Work Opportunity

2019-01-30 Thread Nigel Copley
Yes, we have access to an office network where you can work from any of
their offices for the day

On Wed, 30 Jan 2019, 11:50 Roshan Shah  3000 global offices ? 
>
> On Tue, Jan 29, 2019 at 6:40 PM  wrote:
>
>> https://work.vendably.com/o/experienced-python-developer-remote-working
>>
>> --
>> 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/19561b48-3832-42a8-8c6d-f46e408d6074%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> --
>
> Roshan Shah / Sr. IT Consultant
> techieros...@gmail.com / (519) 496-8860
>
> This e-mail message may contain confidential or legally privileged
> information and is intended only for the use of the intended recipient(s).
> Any unauthorized disclosure, dissemination, distribution, copying or the
> taking of any action in reliance on the information herein is prohibited.
> E-mails are not secure and cannot be guaranteed to be error free as they
> can be intercepted, amended, or contain viruses. Anyone who communicates
> with me by e-mail is deemed to have accepted these risks.
>
> --
> 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/CALX19Ni_N1zwzN37MOZtZSqqtrSxRMmCQ27CQngQdj9iAN5yYQ%40mail.gmail.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/CAFtSCBjNKGppJoak_kskmGWVxv%3D%3DaJSWD6oKiZDkhWA1mcw2ug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: PasswordResetConfirmView doesn't work through redirect in newest Safari

2019-01-30 Thread René Fleschenberg
Hi,

I am currently using the code below as a workaround.

Please be super-careful with this. I did not test this extensively. Do
not use it if your password reset page requests external resources. Make
sure you understand the security implications before you deploy it.

apollo13 suggested this on IRC as a temporary fix, but any bugs in the
implementation are mine. Obviously, no warranty ;)


```
from django.contrib.auth import views as auth_views
from django.contrib.auth.views import INTERNAL_RESET_SESSION_TOKEN
from django.utils.decorators import method_decorator
from django.views.decorators.cache import never_cache
from django.views.decorators.debug import sensitive_post_parameters


class PasswordResetConfirmView(auth_views.PasswordResetConfirmView):

# https://code.djangoproject.com/ticket/29975

@method_decorator(sensitive_post_parameters())
@method_decorator(never_cache)
def dispatch(self, *args, **kwargs):
assert 'uidb64' in kwargs and 'token' in kwargs

self.validlink = False
self.user = self.get_user(kwargs['uidb64'])

if self.user is not None:
token = kwargs['token']
if self.token_generator.check_token(self.user, token):
self.validlink = True
form = self.get_form()
if form.is_valid():
self.request.session[
INTERNAL_RESET_SESSION_TOKEN
] = 'dummy'
return self.form_valid(form)
return self.form_invalid(form)

return self.render_to_response(self.get_context_data())
```


-- 
René Fleschenberg

-- 
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/6898cb45-0128-9648-9b70-3294ff6c58a4%40fleschenberg.net.
For more options, visit https://groups.google.com/d/optout.


Re: PasswordResetConfirmView doesn't work through redirect in newest Safari

2019-01-30 Thread Jason
I agree, when you hear hoofbeats, you think horses and not zebras. Except 
in this case, it was indeed a zebra you saw :-)

-- 
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/5f083fb0-ff00-4d99-8f71-2793cac79aee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Any advice on linguistic project?

2019-01-30 Thread Carlos Eduardo
You can do all that stuff with Python and use Django as an UI. 

I'm doing something similar. I'm from computational linguistics area as 
well.

My first advice for you is to study a special book related to python and 
linguistics. The book is not 100% but the read it is worthwhile.
Here is the link:

https://faculty.sbs.arizona.edu/hammond/ling508-f17/pyling.pdf

This text will open your mind. 

As soon as you get pro I suggest you to to start using the NLTK tools for 
python:

https://www.nltk.org/

These materials will give you a solid basis and most of your needs will be 
fully covered. 
However if you need something more specific you can convert any algorithm 
to Python and create your own modules. 

In case you can share them on github for others members of the community 
use it as well would be a plus.

thanks!! 

Em quarta-feira, 30 de janeiro de 2019 10:24:33 UTC-2, monkb...@gmail.com 
escreveu:
>
> I'm a student of linguistics and just started to learn python and django a 
> few months ago. Planning to apply some utilities of linguistic with some 
> advanced function into a showcase on the website, but still not sure how to 
> achieve it through django.
>
> Can anyone recommend some similar projects(package) for me to learn from?  
> (basic function like corpora analyse, comparison, some words statistics, 
> simple graphic illustration, and any guru technique is welcomed too !) 
>
> Really appreciate your advice, 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/52b1b21f-de76-47e2-b0b8-cfafe8519d6f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Work Opportunity

2019-01-30 Thread Mohamed Hashi
i have a problem in my django
i allready did start the project
i would to get help and discuss about things
any ready for helping me
this is my whatsapp number
00918686910983
thanks

‫في الأربعاء، 30 يناير 2019 في 5:10 ص تمت كتابة ما يلي بواسطة <‪
caleor...@gmail.com‬‏>:‬

> https://work.vendably.com/o/experienced-python-developer-remote-working
>
> --
> 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/19561b48-3832-42a8-8c6d-f46e408d6074%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/CAOiYw3v__iWdGivtoqZE%2Bojv9YNOQ3%2BEuCBdzQVGXAPNjkPPjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Begginner

2019-01-30 Thread Gil Obradors
Hi Franjhohn,

With a bit knowleges of python, and time you can start here :
https://www.djangoproject.com/start/
Read and do the first app that is in the manual.

Or you can start with a book : I recommend you this editorial
https://www.packtpub.com/

Else at the beginning is not easy, the learning curve exists. But in the
middle I can assure you will recollect fruits.




Good luck!



Missatge de Frank john thompson  del dia dc., 30 de
gen. 2019 a les 13:24:

> how do i build webside on python using django?
>
> --
> 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/a9b4d604-f34e-494e-a156-8170aa1e9a75%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/CAK-JoTRpv37HuR53ujSWx6JzcrzCns4VabXOGUEkHgPSE%3DcRag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Begginner

2019-01-30 Thread KONE GOMPOU LOUA ALASSANE
Vert simple

Le mer. 30 janv. 2019 à 12:24, Frank john thompson  a
écrit :

> how do i build webside on python using django?
>
> --
> 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/a9b4d604-f34e-494e-a156-8170aa1e9a75%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
*La meilleure façon de prédire l’avenir est de le créer. *

-- 
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/CANoHCst1skSsesNhC2zMKPb_SvVp%3DSrJOP82YhfSAnVd5oz6uQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Credit Tool Django Pycharm

2019-01-30 Thread AfFromDaEast
Hi guys, I am doing a university project on a credit score tool. I am
supposed to use the FICO dataset to assign points for each question the
user answers to deliver a credit score. My research has shown that I should
use a scorecard. Is this true? Does anyone have any idea on how to do this,
I'd really appreciate the help.
-- 
Yours Truly,

*Team AF *

Twitter : AfFromDaEast
Instagram : AfFromDaEast

#*MoreThanMusic*

-- 
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/CALPqB8u-RpgW446xp_3OS4RL8Q85B_VMbp22s6iZ5jn8UT3UEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Begginner

2019-01-30 Thread Frank john thompson
how do i build webside on python using django?

-- 
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/a9b4d604-f34e-494e-a156-8170aa1e9a75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Any advice on linguistic project?

2019-01-30 Thread monkbirdark
I'm a student of linguistics and just started to learn python and django a 
few months ago. Planning to apply some utilities of linguistic with some 
advanced function into a showcase on the website, but still not sure how to 
achieve it through django.

Can anyone recommend some similar projects(package) for me to learn from?  
(basic function like corpora analyse, comparison, some words statistics, 
simple graphic illustration, and any guru technique is welcomed too !) 

Really appreciate your advice, 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/e500e663-c102-4665-9ca4-4abc75ca14f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Fwd: data sharing with multiple clients by server simultaneously

2019-01-30 Thread shiva kumar
-- Forwarded message -
From: shiva kumar 
Date: Tue 29 Jan, 2019 11:21 pm
Subject: data sharing with multiple clients by server simultaneously
To: 


Hi guys. I have a doubt regrading communication b\w client and server.
consider an example there are 20 clients continuously connected and share
data with server and server response to there request.
my requirements are
 What are all the concepts needed inorder to make it? and some alternatives.

thank u

-- 
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/CAMsYeuHDdKcLh4BfYB2PzqNQXNuWNCqTVH4pjO-jSHXvnLxGXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Work Opportunity

2019-01-30 Thread Roshan Shah
3000 global offices ? 

On Tue, Jan 29, 2019 at 6:40 PM  wrote:

> https://work.vendably.com/o/experienced-python-developer-remote-working
>
> --
> 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/19561b48-3832-42a8-8c6d-f46e408d6074%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
-- 

Roshan Shah / Sr. IT Consultant
techieros...@gmail.com / (519) 496-8860

This e-mail message may contain confidential or legally privileged
information and is intended only for the use of the intended recipient(s).
Any unauthorized disclosure, dissemination, distribution, copying or the
taking of any action in reliance on the information herein is prohibited.
E-mails are not secure and cannot be guaranteed to be error free as they
can be intercepted, amended, or contain viruses. Anyone who communicates
with me by e-mail is deemed to have accepted these risks.

-- 
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/CALX19Ni_N1zwzN37MOZtZSqqtrSxRMmCQ27CQngQdj9iAN5yYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


No "change password" link on user change_form in Django 2.0.4

2019-01-30 Thread Oivvio Polite
Django version: 2.0.4

I noticed that there is no link for chaning the user password on the
change user view in Django admin. In older versions of Django (like
1.10) that link was there by default.

I'm not talking about chaning the password of the logged in user. That's
working fine.

I'm talking about when the superuser wants to change the password of
another user.


-- 
Oivvio Polite - http://liberationtech.net

-- 
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/20190130112046.tzzquvdamwpwuypl%40blomma.liberationtech.net.
For more options, visit https://groups.google.com/d/optout.


Re: Limiting a SubQuery based on instance's OuterRef

2019-01-30 Thread Nick Gashkov
Simon,

Thank you for fast reply! I've tried to rewrite a query using RowNumber()...

inner_subquery = queryset.objects.filter(date__gte=today, 
day_type='working_day')
inner_subquery = 
inner_subquery.annotate(row_number=Window(expression=RowNumber(), 
order_by=F('number').asc()))
inner_subquery = inner_subquery.filter(pk=OuterRef('pk'))
inner_subquery = inner_subquery.values('row_number')[:1]

outer_subquery = queryset.objects.annotate(row_number=Subquery(inner_subquery))
outer_subquery = outer_subquery.filter(row_number=OuterRef('number'))
outer_subquery = outer_subquery.values('value')[:1]

queryset = queryset.annotate(result=Subquery(outer_subquery))


...but stumbled upon a following exception:

Expression contains mixed types. You must set output_field.

Am I doing something wrong?

-- 
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/3eb689ea-873e-4dae-929b-5f2510f01c79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-30 Thread Ivan Martić
>
> Bok Nebojša, jel možeš uletit i pogledati molim te što radim krivo.
>>
>> Znači, imam 2 aplikacije, prva abc radi a druga product groups ne radi..
>> Sve je kopirano u 2 privitka.
>>
>> Da li imaš vremena pogledati pliz?
>>
> Šta god napravim, No reverse mi se javlja...

-- 
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/CAFab_C8%2BhPxKUsLah%3D%3DtOrn8ro8-DgA3GFhy8%2Bz99kF4r80tog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
app 1
view:
from django.shortcuts import render, redirect
from django.http import HttpResponse
from .models import AbcClassification
from django.db import connection
from .forms import AbcForm
from django.core.mail import send_mail
from django.conf import settings
from django.core.mail import send_mail
from django.contrib import messages
import time
from django.contrib.auth import login, logout
from django.contrib.auth.decorators import user_passes_test, login_required

def check_user(user):
if user.groups.filter(name='abc_all').count() == 1:
return True
return False

@login_required(login_url='/accounts/login/')
@user_passes_test(check_user, login_url='/denied')

def abc_view(request):
queryset = AbcClassification.objects.all()
context = {
"lista" : queryset,
}
return render(request, "qif/abc.html", context)

@login_required(login_url='/accounts/login/')
@user_passes_test(check_user, login_url='/denied')

def abc_update_view(request, url_id):
abc_lista = AbcClassification.objects.get(id=url_id)
abc_url_id = AbcForm(request.POST or None, instance=abc_lista)
context1 = {'abc_url_id': abc_url_id, 'abc_lista': abc_lista}

if abc_url_id.is_valid():
abc_url_id.save()
messages.success(request, 'Your entry has been saved. Relevant 
persons will be informed of this change.')
return render(request, 'qif/abc-update.html', context1)

url:
from django.urls import path
from . import views


urlpatterns = [
path('', views.abc_view, name='abc'),
path('update//', views.abc_update_view, name='update_abc'),
]


model:
from __future__ import unicode_literals
from django.db import models, connection
from django.utils import timezone
from simple_history.models import HistoricalRecords
from django.contrib.auth.models import User




class AbcClassification(models.Model):
id = models.IntegerField(db_column='ID', primary_key=True)
class_field = models.CharField(db_column='Class', max_length=1)
value = models.SmallIntegerField(db_column='Value')

history = HistoricalRecords()


class Meta:
managed = False
db_table = 'ABC_Classification'

def __str__(self):
return '%s %s' % (self.class_field, self.value, self.id)


app2

view:
from django.shortcuts import render, redirect
from django.http import HttpResponse
from .models import Material4, MaterialGroup
from django.db import connection
from .forms import ProductgroupinputForm, MaterialGroupForm
from django.core.mail import send_mail
from django.conf import settings
from django.core.mail import send_mail
from django.contrib import messages
from django.db.models import Q
from django.contrib.auth import login, logout
from django.contrib.auth.decorators import user_passes_test, login_required
from django.shortcuts import get_object_or_404

def check_user(user):
if user.groups.filter(name='productsgrouping_all').count() == 1:
return True
return False


#novi views
@login_required(login_url='/accounts/login/')
@user_passes_test(check_user, login_url='/denied')

def productsgrouping_view(request):
queryset = MaterialGroup.objects.all()
#not_assigned = 
Material4.objects.filter(input_group__isnull=True).count()
context = {
"lista" : queryset, 
#"not_assigned":not_assigned
}

return render(request, 'qif/productsgrouping/productsgroup.html', 
context)

@login_required(login_url='/accounts/login/')
@user_passes_test(check_user, login_url='/denied')

def productsgrouping_update_view(request, url_id):
#assigned = get_object_or_404(id=url_id)
assigned = Material4.objects.filter(input_group=url_id)
not_assigned = None
search = request.GET.get("search", None)

if search:
not_assigned = 
Material4.objects.filter(Q(materialid__icontains=search) | 
Q(maktx__icontains=search))


product_lista = MaterialGroup.objects.get(id=url_id)
#product_lista = get_object_or_404(MaterialGroup,