Re: Django Admin keeps redirecting to login page repeatedly

2017-02-14 Thread Tim Graham
No idea but it seems like you should update your requirements per that project's readme: "Please note that django-zappa has been superceded by Zappa , which includes all of the django-zappa features and more!" Even the latest version of django-zappa doesn't ha

How to login different user each on different pages using class based views

2017-02-14 Thread JJEMBA KENNETH
Hello guys, I started using django a month back and I have been using class based views. they are pretty good. Then am wondering how i can use them to implement different categories of user where each is redirected to a different page. Can anyone please help me with that. -- Jjemba Kenneth -- Y

Re: Saving Data in Multiple Selected Checkbox for Voting System

2017-02-14 Thread Genaro Lubong
so I need to provide it? I am using def views for the template On Feb 10, 2017 7:14 PM, "ludovic coues" wrote: > You didn't provide the view making use of that template > > 2017-02-10 10:49 GMT+01:00 Genaro Lubong : > > please help me guys > > > > > > On Feb 8, 2017 12:33 AM, "Genaro Lubong" wro

Re: Django Admin keeps redirecting to login page repeatedly

2017-02-14 Thread Abdul Wahid
Yes, I removed that middleware and its working fine now. I would always keep an eye these third party tools before blaming to django core. Thanks for the advice. Regards, Abdul Wahid On Tue, Feb 14, 2017 at 3:59 PM, Tim Graham wrote: > No idea but it seems like you should update your requiremen

Re: django telebot ... !

2017-02-14 Thread Cassady Steel
I will UP this question :) Amazon AWS. EC2 T2.micro Ubuntu $ /usr/bin/python3 >>> import telebot >>> token = "567891234:AAFcanBedGboDfLgVCak-Bqqc3i2NZfiGlg" (not actualy my token) >>> bot = telebot.TeleBot(token) >>> bot_id = bot.get_me() >>> print(bot_id) {'ok': False, 'error': 'Got unexpected

Inconsistent types in PostgreSQL RangeFields

2017-02-14 Thread francois-xavier . thomas
Hello all, I've been hitting a small annoyance when using the RangeField classes in the PostgreSQL contrib modules : while the value returned by psycopg is a psycopg.extras.Range type, the Django documentation explicitly mentions using tuples when creating and updating model instances. This me

Re: How to login different user each on different pages using class based views

2017-02-14 Thread ludovic coues
I would add a get_redirect_url method on all user model, which give a different url depending on the user category. Then use a redirect url with a get_redirect_url method returning the value of get_redirect_url from the user. If you want to use url name instead of path, use django.urls.reverse 20

Re: Saving Data in Multiple Selected Checkbox for Voting System

2017-02-14 Thread ludovic coues
You provided vote from views.py but vote redirect the user. It does not use the provided voting.html template. Also, in my opinion, they are way too many if and for. You have three, nested, loops. And you are using only a subset of each loop data. I assume position.organization is a foreign key. S

Re: Inconsistent types in PostgreSQL RangeFields

2017-02-14 Thread Tim Graham
The documentation says, "All of the range fields translate to psycopg2 Range objects in python, but also accept tuples as input if no bounds information is necessary." It looks to me like you could initialize the objects using psycopg's Ra

BlogEngine2 0.6.5 release

2017-02-14 Thread Etienne Robillard
Hi, I'm thrilled to announce the release of BlogEngine2 API. http://isotopesoftware.ca/pub/blogengine2/blogengine2-0.6.5.tar.gz BlogEngine is a lightweight microblogging API for Django. Bitbucket page: https://bitbucket.org/tkadm30/blogengine2 Whats new: - Initial alpha release. - Require ZOD

Using postgres ts_rank's normalization parameter in django?

2017-02-14 Thread Thomas Nyberg
Hello, I've been looking at the documentation on this page: https://docs.djangoproject.com/en/1.10/ref/contrib/postgres/search/ I am trying to use the postgres ts_rank function as exposed through django. The ts_rank function in postgres can be called in (at least) two ways:

Re: Django documentation tutorial part 1

2017-02-14 Thread Dário Carvalho
I'm seeing your post only know. Sorry. In deed I used 127.0.0.1:8000 without the /polls when I first ran the server. When I tried with the /polls could finally see the page. 2017-02-07 11:18 GMT-02:00 Gerald Brown : > Have you tried using "127.0.0.1" instead of "localhost"? I had a similar > pro

Re: Saving Data in Multiple Selected Checkbox for Voting System

2017-02-14 Thread Genaro Lubong
thank you so much, it helped me a lot, gonna few more for further errors, I may encounter, thanks a lot On Feb 14, 2017 9:48 PM, "ludovic coues" wrote: > You provided vote from views.py but vote redirect the user. It does > not use the provided voting.html template. > > Also, in my opinion, they

Re: Django documentation tutorial part 1

2017-02-14 Thread Alexis Carmona
Hey, I checked your code on githubt and i think that you missed yo import your views in your urls file El lunes, 6 de febrero de 2017, 17:12:30 (UTC-4), Philip escribió: > > Hello, > > I am working through the tutorial included with the django documentation, > and I am confused as to why my url

Is it possible to Atomically check limit and Increment/decrement a counter field in multiple tables ?

2017-02-14 Thread sarvi
I have 2 tables Cluster and Node, each having a volume_limit and volume_count column in it. To atomically check and increment the volume count for a Cluster and Node I do the following updated = Cluster.objects.filter(id=cluster_id, volume_count__lt==F('volume_limit')).update(volume_count = F('

Check if all boolean values are the same (database)

2017-02-14 Thread Victor Porton
# May contain several purchases class Transaction(models.Model): name = models.CharField(null=True) class Purchase(models.Model): bundle = models.ForeignKey(Transaction, null=True) recurring = models.BooleanField(default=False) For a given transaction, all its purchases must either al

Re: Check if all boolean values are the same (database)

2017-02-14 Thread Shawn Milochik
I'd go with form validation -- you shouldn't allow a Purchase to be added to a transaction if a Purchase with a conflicting status is already in there, nor should a Purchase be able to be modified if it's in a transaction with another Purchase. Then you never have to check whether a transaction is

Re: Pagination is not showing and also not working

2017-02-14 Thread Kazi Atik
On Monday, February 13, 2017 at 1:03:23 AM UTC+5:30, Kazi Atik wrote: > > here is my views/ > > from django.contrib.auth.models import User > > from django.core.paginator import Paginator,EmptyPage, PageNotAnInteger > from friends.models import Friendship,UserProfile > from django.http import Htt

Re: Is it possible to save children before parents?

2017-02-14 Thread Mike Dewhirst
Logically, this is a tail-chasing exercise. The total sum of ingredient proportions is calculated from a query of ingredients. It runs when saving the mixture. It can only get previously saved data. Aaaargh!!! I forgot to tell you that the ingredients are inlines and proportions get saved whe

Re: Is it possible to save children before parents?

2017-02-14 Thread Antonis Christofides
Hi, the problem you are having has some resemblance to a problem I once faced, http://stackoverflow.com/questions/33500336/checking-integrity-of-manytomanyfield. It's not the same; my problem was to check the integrity of the "children", whereas you seem to have a problem with the admin. However i

Re: Is it possible to save children before parents?

2017-02-14 Thread Mike Dewhirst
On 15/02/2017 6:01 PM, Antonis Christofides wrote: Hi, the problem you are having has some resemblance to a problem I once faced, http://stackoverflow.com/questions/33500336/checking-integrity-of-manytomanyfield. It's not the same; my problem was to check the integrity of the "children", whereas