Re: Regular Expression with Variables.

2016-05-18 Thread Stephen J. Butler
I think I'd just use format() on the regex, being careful to escape '{' and '}': regex_f=r'^.*(?=.*{{{MIN},{MAX}}}*)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^ &*?@#-_+=])' regex=regex_f.format(MIN=settings.MY_RE_MIN, MAX=settings.MY_RE_MAX) On Thu, May 19, 2016 at 12:37 AM, Arun S

Regular Expression with Variables.

2016-05-18 Thread Arun S
Hi, I have a Regular Expression something like this: regex=r'^.*(?=.*{8,}*)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=])' r'.*$', In this, i would like to read the values from the Django Setting file on the Max and Min Length and provide them as my input instead of Hard

django queryset/annotate get extra column

2016-05-18 Thread stunaz
Hi, I would like to write the following query using django orm. select * , (select image_url from blog_image bi where bi.blog_id = b.id and bi. principal=1) as blog_main_imange from blog b Any idea, how to write the queryset ? -- You received this message because you are subscribed to the

Re: Is there a spanish version of Two Scoops of Django?

2016-05-18 Thread Luis Zárate
That sound very good, so if you need help with translations I could help you in my few free time. Break language barrier is so important for me, I think more people could learn django faster and without discrimination. So ViVa la libertad. :) El martes, 17 de mayo de 2016, David Alejandro Reyes

django middleware process exception not call

2016-05-18 Thread Luis Zárate
Hi, I was working with middleware that catch exceptions and redirect to other view depending of except type. My idea was raise custom exceptions in several parts of the code and catch in middlewaware with proces exception function, but I have an exception raise in template tag when template is

Re: Django send_mail smtp gmail

2016-05-18 Thread James Schneider
> >>> from django.core.mail import send_mail > >>> send_mail('subject is', 'message is and is not 12342', ' fromem...@gmail.com', ['sen...@gmail.com']) > 1 > >>> > > I am receiving this email in my gmail account, incidently which is the same gmail account used for the smtp, but the from email is

Django send_mail smtp gmail

2016-05-18 Thread ofeyofey
Hi, I have set up smtp with a gmail account. When I use send_mail the from email is not showing up in the account receiving the email. Django settings.py # DEFAULT_FROM_EMAIL = 'sen...@gmail.com' EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com'

Re: A question on save_m2m()

2016-05-18 Thread Ankush Thakur
Ah! Stupid, stupid me. Thanks a lot for clarifying! :-) Best, Ankush On Wednesday, May 18, 2016 at 12:15:57 PM UTC+5:30, James Schneider wrote: > > > > On Sat, May 14, 2016 at 2:42 AM, Ankush Thakur > wrote: > >> So the following section from the docs has me a little

sub accounts in django

2016-05-18 Thread Mehdy M. Haghy
Creating sub accounts is a pretty common scenario. you have clients like (copmany1, company2, ..., company N) and they have their own users, roles and permissions. any recommendation on how to implement this or any package recommendation? -- You received this message because you are subscribed

Re: Why not working exampe from Django docs

2016-05-18 Thread Tim Graham
It might be that the meta class should be removed (or at least, app_label should refer to the actual label of your app): class Meta: app_label = 'mysessions' Does it work if you do that? Do you have the app in INSTALLED_APPS? On Wednesday, May 18, 2016 at 8:39:48 AM UTC-4, Seti Volkylany

Why not working exampe from Django docs

2016-05-18 Thread Seti Volkylany
https://docs.djangoproject.com/en/1.9/topics/http/sessions/#example from django.contrib.sessions.backends.db import SessionStore as DBStorefrom django.contrib.sessions.base_session import AbstractBaseSessionfrom django.db import models class CustomSession(AbstractBaseSession): account_id =

Booleanfield in Admin/ shows wrong data (Django 1.8)

2016-05-18 Thread 'Uwe Küllmar' via Django users
Hello, I installed a new Server with DB2/LINUXX8664 10.5.7, Django 1.8.13, ibm_db 2.0.7 and ibm_db_django 1.0.9.2. After restoring my database on the new system (source was also db2 with django 1.7) I have the problem that the check boxes in the admin area shows wrong data. All Check boxes

Re: Django Password Validation

2016-05-18 Thread Arun S
Hi, Thanks for the Suggestion. James, in the option that you provided makes the User change the Password of the Logged in user which might turn out to be a costly operation. But Yes, validating within the View and then using Authenticate() does sound easier.

Re: Django Password Validation

2016-05-18 Thread James Schneider
On Wed, May 18, 2016 at 12:08 AM, Arun S wrote: > Hi , > > I have a small issue with the Validation of Passwords in the Change > Password Page. > > Due to certain different requirements, i have written my own Custom Forms > for Change Password. > > Now in this, I would want

Re: Django Password Validation

2016-05-18 Thread orzodk
Arun S writes: > Hi , > > I have a small issue with the Validation of Passwords in the Change Password > Page. > > Due to certain different requirements, i have written my own Custom Forms for > Change Password. > > Now in this, I would want to first Validate the Old

Django Password Validation

2016-05-18 Thread Arun S
Hi , I have a small issue with the Validation of Passwords in the Change Password Page. Due to certain different requirements, i have written my own Custom Forms for Change Password. Now in this, I would want to first Validate the Old Password Field with the Current Users Password. The

Re: A question on save_m2m()

2016-05-18 Thread James Schneider
On Sat, May 14, 2016 at 2:42 AM, Ankush Thakur wrote: > So the following section from the docs has me a little confused: > > = > Another side effect of using commit=False is seen when your model has a > many-to-many relation with another model. If