django ModelForm: error name 'self' is not defined

2014-12-08 Thread JAI PRAKASH SINGH
hello all, I am trying to make a registration form using User model so i am using ModelForm as I am using bootstrap template i need to add some atribute like class placeholder so i am using widget, am facing a problem , i searchd a lot but unable to find the solution please help my

Beginner: What are the pitfalls of using an html form without using django forms? I.e. form.py

2014-12-08 Thread T Kwn
I'm created a form where a user can add or remove other users from a group. Because the number of available users is unknown beforehand, I needed to create a checkbox form where the number of elements is dynamic. However, I couldn't figure out how to do it so I just used an html form and some

Re: Backup vs Audit

2014-12-08 Thread Russell Keith-Magee
Hi Andrea, In short, you don't - at least, not out of the box. That's not what Django's admin interface is for. Django's admin is a quick-and-dirty CRUD interface you can throw over some models, with some customisation hooks that means it has a lifespan beyond initial bootstrapping. It isn't a

Re: How to hide the 'empty entry' value in forms relating as ForeignKey?

2014-12-08 Thread inoyon artlover KLANGRAUSCH
just set 'initial=False' within the form-field works! Am Sonntag, 7. Dezember 2014 19:57:12 UTC+1 schrieb inoyon artlover KLANGRAUSCH: > > Hi there, I got a form: > > class Answers(models.ModelForm): > > psyq11 = forms.ModelChoiceField( >

Re: POSTing data to a django view from a stand alone script with CSRF

2014-12-08 Thread Carl Meyer
On 12/08/2014 09:51 AM, Larry Martell wrote: > Right, but anyone can write a script to bypass the CSRF protection. I > was surprised that it would be so easy to do that. I guess that's not > what CSRF was designed to protect against. Right. There's no such thing as a CSRF attack via script. The

Re: POSTing data to a django view from a stand alone script with CSRF

2014-12-08 Thread Larry Martell
On Mon, Dec 8, 2014 at 11:44 AM, Carl Meyer wrote: > Hi Larry, > > On 12/08/2014 07:14 AM, Larry Martell wrote: >> On Sat, Dec 6, 2014 at 1:41 AM, James Schneider >> wrote: >>> Check out Collin's email from earlier, it has an example using curl but you

Re: POSTing data to a django view from a stand alone script with CSRF

2014-12-08 Thread Carl Meyer
Hi Larry, On 12/08/2014 07:14 AM, Larry Martell wrote: > On Sat, Dec 6, 2014 at 1:41 AM, James Schneider > wrote: >> Check out Collin's email from earlier, it has an example using curl but you >> should be able to adapt your web request with the cookie and POST values

Django server and Apache serving static files

2014-12-08 Thread pythonista
My apache admin is having problems serving static files to the django app. Apache is on its own server. My admin says that he needs a relative path defined in Django in order to get Apache to serve the static files from that server for the Django App Is it possible to define relative paths in

Re: POSTing data to a django view from a stand alone script with CSRF

2014-12-08 Thread Larry Martell
On Sat, Dec 6, 2014 at 1:41 AM, James Schneider wrote: > Check out Collin's email from earlier, it has an example using curl but you > should be able to adapt your web request with the cookie and POST values via > the python script. The cookie and POST values for the CSRF

Backup vs Audit

2014-12-08 Thread Andrea Zakowicz
Hi I wonder if you are aware of how to backup / restoration database and audit from the django admin. -- 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

Re: Changes to Model does not migrate to sqlite with Django 1.7?

2014-12-08 Thread Daniel Roseman
On Monday, 8 December 2014 11:07:11 UTC, Tobias Dacoir wrote: > So what am I doing wrong? I'm sure it's just my fault. At first I even > manually edited the migrations file in the past, for example when I changed > one of the fields to be mandatory instead of being optional. Old data in >

django-reversion live site with source code

2014-12-08 Thread wwiras
Hi! Is there any django sites that are using django-reversion for me to see the demo and download the source code for a better understanding on how its work. Help is needed. Regards, wwiras -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Non-editable (but visible) fields in admin?

2014-12-08 Thread Jesus Peña Siguas
readonly_fields=('campo',) El jueves, 16 de julio de 2009 22:11:20 UTC-5, Rubens Altimari escribió: > > Hello, > > Is there a way to show model fields in admin, but prevent them from > being edited? Using 'editable=False' in the model won't do, since then > the field simply is not displayed. >

Re: Changes to Model does not migrate to sqlite with Django 1.7?

2014-12-08 Thread Markus Holtermann
I tried to reproduce the problem with the steps you explained, but it works fine for me. Can you post your existing migration files for that app too, please. This will then hopefully give us some hints to solve your problem. On Monday, December 8, 2014 12:07:11 PM UTC+1, Tobias Dacoir wrote: >

Re: Changes to Model does not migrate to sqlite with Django 1.7?

2014-12-08 Thread Tobias Dacoir
Well, I did follow some best-practice guides and even asked here on the forums on how to model my User class. I want the users to be able to use their username or email as login, and going with this inheriting from AbstractBaseUser and PermissionsMixin is what I was told. Maybe this doesn't

Re: Changes to Model does not migrate to sqlite with Django 1.7?

2014-12-08 Thread Markus Holtermann
A model is always uniquely identified by its app label and model name. Since migrations use that I don't see a way how this could happen. If you have two apps with the same app label the AppRegistry will blow up (and prevents Django from starting). On Monday, December 8, 2014 12:15:30 PM

Re: Changes to Model does not migrate to sqlite with Django 1.7?

2014-12-08 Thread James Schneider
You can also temporarily remove django.contrib.auth from INSTALLED_APPS when making your migrations to keep the overlap from occurring as a test, although I'm not sure if that would be possible if any other code references the contrib User model and probably isn't recommended as a production

Re: Changes to Model does not migrate to sqlite with Django 1.7?

2014-12-08 Thread James Schneider
I have to wonder if the name of your class is causing an overlap with the Django contrib model, which may be causing confusion with the migrations process and not catching changes (since the core contrib version doesn't have any changes). Would it be possible to change the name of the class, even

Re: Changes to Model does not migrate to sqlite with Django 1.7?

2014-12-08 Thread Tobias Dacoir
Ok, here is part of the User Model: class User(AbstractBaseUser, PermissionsMixin): SEX = ( ('m', 'male'), ('f', 'female') ) RANG = ( ('b', 'beginner'), ('e', 'expert'), ('m', 'master') ) username = models.CharField(_('username'),

Re: Changes to Model does not migrate to sqlite with Django 1.7?

2014-12-08 Thread Markus Holtermann
Hi Tobias, can you share the code for your old model and you new model along with the existing migrations for that app, please. Without some details it's hard to figure out what's happening. /Markus On Monday, December 8, 2014 8:23:33 AM UTC+1, Tobias Dacoir wrote: > > Hi, > > I'm having

Re: Changes to Model does not migrate to sqlite with Django 1.7?

2014-12-08 Thread Daniel Roseman
On Monday, 8 December 2014 07:23:33 UTC, Tobias Dacoir wrote: > > Hi, > > I'm having trouble with changes to my Models. I just added a couple of new > fields to my existing models but when I run manage makemigrations it says: > No changes detected. When I try to log in to the admin panel it

Local timezone in django admin

2014-12-08 Thread vamsy krishna
Hi, The default timezone in our application is UTC (stored in the database). However I would like to display the datetime fields on the admin interface based on the user's local timezone. We're using Django 1.6. Thanks, Vamsy -- You received this message because you are subscribed to the