Re: Python: Assign variable in if statement?

2014-12-03 Thread Derek
On Sunday, 30 November 2014 18:23:22 UTC+2, Masklinn wrote: > > > On 2014-11-30, at 12:30 , ThomasTheDjangoFan < > stefan.eich...@googlemail.com > wrote: > > Hi guys, > > coming from php I am wondering if there is a way to do something like this > in Python/Django: > > if variable = get_a_value_fr

Re: Django 1.7 problem

2014-12-03 Thread Carl Meyer
Hi Andreas, On 12/03/2014 01:34 PM, Andreas Kuhne wrote: > I am trying to migrate our current website to django 1.7. > > Currently we are using a plugin called django-dbgettext to get parts of our > database translated (we are running in 10 different languages). The problem > is that django-dbget

Re: How to restrict save function in Django admin

2014-12-03 Thread Ezequiel
On Wednesday, December 3, 2014 2:03:56 AM UTC-3, Akshay Mukadam wrote: > > Hi, > I have developed application that loads CSV file, if the input received > while parsing the CSV file in Django admin is wrong, it throws a > stacktrace, to avoid stacktrace I have handled the exception and I am able

Django 1.7 problem

2014-12-03 Thread Andreas Kuhne
I am trying to migrate our current website to django 1.7. Currently we are using a plugin called django-dbgettext to get parts of our database translated (we are running in 10 different languages). The problem is that django-dbgettext starts by going through all of the models and does this before

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-03 Thread Danish Ali
so is there anyway to create slug automatically other than this ? On Thu, Dec 4, 2014 at 1:29 AM, donarb wrote: > On Wednesday, December 3, 2014 11:59:42 AM UTC-8, Danish Ali wrote: >> >> this is stacktrace when I use: slug = AutoSlugField(populate_from='name') >> in my model >> >> >> Environmen

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-03 Thread donarb
On Wednesday, December 3, 2014 11:59:42 AM UTC-8, Danish Ali wrote: > > this is stacktrace when I use: slug = AutoSlugField(populate_from='name') > in my model > > > Environment: > > > Request Method: POST > Request URL: http://127.0.0.1:8000/admin/product/shop/add/ > > Django Version: 1.7.1 > Py

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-03 Thread Danish Ali
this is stacktrace when I use: slug = AutoSlugField(populate_from='name') in my model Environment: Request Method: POST Request URL: http://127.0.0.1:8000/admin/product/shop/add/ Django Version: 1.7.1 Python Version: 3.4.2 Installed Applications: ('django.contrib.admin', 'django.contrib.auth'

Re: Intuition about (potentially) sending multiple password reset emails

2014-12-03 Thread Karen Tracey
The password reset form asks for an email address, not username. (This is assuming default Django User model.) The email address may be associated with more than a single User on the system -- there is no requirement (by default) that the user email address be unique. So a password reset email is g

Intuition about (potentially) sending multiple password reset emails

2014-12-03 Thread Julian Gindi
I'm working with Django's built-in password reset capabilities, and noticed this curious line... https://github.com/django/django/blob/master/django/contrib/auth/forms.py#L231 can someone explain the intuition behind this line? It seems weird to potentially send multiple password reset emails.

django setup error using db2

2014-12-03 Thread 白夜
tristan@NorthStar:~/Coding/NorthStar$ python3 manage.py runserver Performing system checks... System check identified no issues (0 silenced). Unhandled exception in thread started by .wrapper at 0x7fedf8b9c8c8> Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/ibm_d

Re: Test client to a redirect requiring a login doesn't set redirect_chain properly? [2nd follow-up]

2014-12-03 Thread Tim Chase
On 2014-11-30 11:04, Collin Anderson wrote: > As of django 1.7, the admin will redirect to a separate login page > (whatever url reverse('admin:login') returns). > > https://github.com/django/django/commit/be0ad62994a340ad54a0b328771931932a45a899 Shouldn't this reach for reverse(settings.LOGIN_U

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-03 Thread Babatunde Akinyanmi
At this point i think it will be good to paste the stacktrace here On 3 Dec 2014 14:18, "Danish Ali" wrote: > I also used this method. But I got same error in this method too. > > def save(self, *args, **kwargs): > self.slug = slugify(self.name) > super(Shop, self).save(*args, **kwargs) >

Re: Redirect user inside Class-Based views

2014-12-03 Thread Rootz
Thanks again.. On Wednesday, December 3, 2014 10:24:44 AM UTC-5, pjotr wrote: > > You could also look into django-braces that has some mixins to handle some > common operations. > > http://django-braces.readthedocs.org/en/latest/index.html > > > On Tuesday, December 2, 2014 4:10:40 PM UTC+1, Root

Re: any idea

2014-12-03 Thread Avraham Serour
> other projects could use this table? yes > is possible to do this with different projects and different versions of Django yes > be better to use a database with 100 tables and each project becomes applications? depends good luck On Wed, Dec 3, 2014 at 5:40 PM, carlos wrote: > Hello, I need

Re: Problem Making New Django project - please help

2014-12-03 Thread Shashwat singh
> > Django is properly installed but when i try to create a new project --- " > django-admin.py startproject abc " it returns ^^ that error. I've tried almost everything, but nothing seems to fix that. Any help will be highly appreciated. > -- You received this message because you are subscr

any idea

2014-12-03 Thread carlos
Hello, I need help regarding an idea I need to do several projects in django say than 3 project but one of them will have the table users profile User's other projects could use this table? another idea would be the same db for all projects? but this is optimal or not? example: (Project A): has 30

Re: Problem Making New Django project - please help

2014-12-03 Thread Shashwat singh
Django is properly installed but when i try to create a new project --- " django-admin.py startproject abc " it returns ^^ that error. Any help will be highly appreciated. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from thi

Re: Redirect user inside Class-Based views

2014-12-03 Thread pjotr
You could also look into django-braces that has some mixins to handle some common operations. http://django-braces.readthedocs.org/en/latest/index.html On Tuesday, December 2, 2014 4:10:40 PM UTC+1, Rootz wrote: > > thanks > > On Tuesday, December 2, 2014 9:22:32 AM UTC-5, Andréas Kühne wrote:

Re: How to restrict save function in Django admin

2014-12-03 Thread pjotr
Maybe you could show the code to clearly see what you are doing? On Wednesday, December 3, 2014 6:03:56 AM UTC+1, Akshay Mukadam wrote: > > Hi, > I have developed application that loads CSV file, if the input received > while parsing the CSV file in Django admin is wrong, it throws a > stacktrac

Re: Generic Views and Django.contrib.auth

2014-12-03 Thread Rootz
URL Reversing the view where login is required. On Tuesday, December 2, 2014 10:05:35 PM UTC-5, Collin Anderson wrote: > > Hi, > > It's probably possible. Do you mean url reversing the login view, or url > reversing the view where login is required? > > Collin > > On Sunday, November 30, 2014 11:

Re: Generic Views and Django.contrib.auth

2014-12-03 Thread Rootz
Yes On Tuesday, December 2, 2014 10:05:35 PM UTC-5, Collin Anderson wrote: > > Hi, > > It's probably possible. Do you mean url reversing the login view, or url > reversing the view where login is required? > > Collin > > On Sunday, November 30, 2014 11:07:42 PM UTC-5, Rootz wrote: >> >> Hi can th

Re: Generic Views and Django.contrib.auth

2014-12-03 Thread Marcus Cl
yes On Tue, Dec 2, 2014 at 10:05 PM, Collin Anderson wrote: > Hi, > > It's probably possible. Do you mean url reversing the login view, or url > reversing the view where login is required? > > Collin > > On Sunday, November 30, 2014 11:07:42 PM UTC-5, Rootz wrote: >> >> Hi can this work with url

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-03 Thread Danish Ali
I also used this method. But I got same error in this method too. def save(self, *args, **kwargs): self.slug = slugify(self.name) super(Shop, self).save(*args, **kwargs) Please let me know if this is correct or not. -- You received this message because you are subscribed to the Google