Re: New field in django

2013-09-08 Thread carlos
Hi try this ./manage.py convert_to_south myapp # if your app exist try read the doc http://south.readthedocs.org/en/latest/convertinganapp.html#converting-an-app Cheer, On Sun, Sep 8, 2013 at 11:29 PM, Xavier Ordoquy wrote: > Hi, > > The message is: "Table 'tcc_report'

Re: Complex query

2013-09-08 Thread Jani Tiainen
Problem is that you have to be able to express it in SQL. And thus ther is not much you can do in SQL to get what you actually wanted. Considering amount of the data fetched - it's relatively low query count and unless you're hitting very busy site you wont notice much of difference doing this

Re: New field in django

2013-09-08 Thread Xavier Ordoquy
Hi, The message is: "Table 'tcc_report' already exists" This means that you already created the tables with syncdb which bypassed south and you're trying to created them again with south. You'll be able to recover from this by: - ensuring your models are in line with your current DB schema -

Re: New field in django

2013-09-08 Thread Harjot Mann
On Mon, Sep 9, 2013 at 3:46 AM, Roberto López López wrote: > You have to fake the migration. Didn't get you. Please elaborate. -- Harjot Kaur Mann Blog: http://harjotmann.wordpress.com/ Daily Dairy: http://harjotmann.wordpress.com/daily-diary/ -- You received this

Re: Django: How to combine 3-party apps!

2013-09-08 Thread Germán
Posting the structure without the "garbage" (.pyc, ~) would help. You have a lot of things mixed up. I suggest you start with a clean project and follow the exact installation instructions of Zinnia. Otherwise it's quite difficult to detect the errors you have. On Saturday, September 7, 2013

Re: Test using different database

2013-09-08 Thread Germán
Antony. Developers using different database engines is a very bad practice and WILL cause you troubles sooner or later. I don't get something from your question: are both engines supposed to be used at the same time or do you want to select a specific one to runt the test suite? On Friday,

Re: Forms template renders 'bad' html

2013-09-08 Thread Germán
Please post the code in question so someone can help you out. If you are having doubts with the tutorial, you may check https://github.com/glarrain/django-tutorial-source-code On Sunday, September 8, 2013 8:42:45 AM UTC-5, qdinthialand wrote: > > I'm new to Django, working through the Polls

Re: custom signup form

2013-09-08 Thread Germán
Anil, please beware that there are lots of code posted on the internet, many of which are faulty or at least don't follow best or standard practices. Copy & pasting will bite you, sooner or later. I recommend you to go over the (excellent) documentation of Django before actually working with

Re: bad request 400

2013-09-08 Thread Germán
If you don't post your code it's quite difficult to help you On Sunday, September 8, 2013 3:34:33 PM UTC-5, Marcin Szamotulski wrote: > > Hello, > > I start working on a new app. I started in the usual way (with > django-admin.py startproject, configured the settings (nothing special >

Mezzanine Gunicorn Problem

2013-09-08 Thread val_erie
Hello everyone, I am having a problem starting Mezzanine with Gunicorn. I used 'gunicorn myproject.wsgi:application' command and got ImportError: No module named myproject.wsgi, so I used export PYTHONPATH=$PYTHONPATH:/path_to_folder_where_myproject_is . After that in python shell I could

Re: django security

2013-09-08 Thread Mike Dewhirst
On 8/09/2013 3:23am, Natko Perko wrote: I browsed through books like Pro Django, Two scoops, Effective Django etc. and I pretty much found the same things as in the documentation. I was hoping to find, as I said before, a version for dummies with things explained from the basics or sowhat, like

Re: Exception Value: global name 'dictfetchall2' is not defined

2013-09-08 Thread Cal Leeming [Simplicity Media Ltd]
Ah sorry yeah, I forgot you needed @staticmethod decorator on the class method. To be honest though, that method should be a standalone function, not a method (as James said, you need to re-think your approach!) Cal On Sun, Sep 8, 2013 at 9:25 PM, Pepsodent Cola wrote:

Re: Exception Value: global name 'dictfetchall2' is not defined

2013-09-08 Thread Pepsodent Cola
*[ Problem Solved ]* - Thanks James! * http://www.sthurlow.com/python/lesson08/ * http://mypythonnotes.wordpress.com/2008/09/07/functions-and-boundunbound-methods/ * http://stackoverflow.com/questions/8108688/in-python-when-should-i-use-a-function-instead-of-a-method

Re: New field in django

2013-09-08 Thread Roberto López López
You have to fake the migration. On 09/08/2013 09:12 PM, Harjot Mann wrote: > I am trying to add a new field to model class in django using south > but when I am running ./manage.py migrate app, I am getting this error > http://202.164.53.122/~harjotmann/southerror > -- Roberto López López

Re: duplicate entry in django

2013-09-08 Thread Lachlan Musicman
Harjot, In your code, inside the is_valid() loop, you have a line that states: return render_to_response('tcc/trans.html', dict(data.\ items()+tmp.items()),context_instance=RequestContext(request)) This needs to be a re-direct. You are currently resending it to the form. If you look at the

Re: Exception Value: global name 'dictfetchall2' is not defined

2013-09-08 Thread Pepsodent Cola
Hi James, Ok will do! On Sunday, September 8, 2013 9:23:48 PM UTC+2, Pepsodent Cola wrote: > > I don't understand how to fix this error message? Here is the code that > made things break. > > Exception Value: global name 'dictfetchall2' is not defined > > > > >

Re: Complex query

2013-09-08 Thread Yegor Roganov
I found out this is a so called "top n per group" problem and it's not that easy to implement in django. Maybe someone could help me to find another way (for example, alter the schema in some way)? -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Exception Value: global name 'dictfetchall2' is not defined

2013-09-08 Thread James Bennett
You wrote a method on a class, but didn't define it as taking the 'self' argument that's required for instance methods of Python classes. It may be best to back up a bit and work through some introductory Python tutorials before resuming on your Django app. -- You received this message because

bad request 400

2013-09-08 Thread Marcin Szamotulski
Hello, I start working on a new app. I started in the usual way (with django-admin.py startproject, configured the settings (nothing special though) and when I try to use my first view function I always get: [08/Sep/2013 21:32:31] "GET / HTTP/1.1" 400 26 (BAD REQUEST) I reviewed my settings

Re: Exception Value: global name 'dictfetchall2' is not defined

2013-09-08 Thread Pepsodent Cola
Hi Cal, I replaced the code with this: row = AltwordManager.dictfetchall2(cursor) Then I got a different error message that I don't understand? ExceptionValue: unbound method dictfetchall2() must be called with AltwordManager instance as first argument (got CursorDebugWrapper

Re: Exception Value: global name 'dictfetchall2' is not defined

2013-09-08 Thread Cal Leeming [Simplicity Media Ltd]
Try and replace row = dictfetchall2(cursor) With this row = AltwordManager.dictfetchall2(cursor) Cal On Sun, Sep 8, 2013 at 8:23 PM, Pepsodent Cola wrote: > I don't understand how to fix this error message? Here is the code that > made things break. > > Exception

Exception Value: global name 'dictfetchall2' is not defined

2013-09-08 Thread Pepsodent Cola
I don't understand how to fix this error message? Here is the code that made things break. Exception Value: global name 'dictfetchall2' is not defined #___ def dictfetchall(cursor): "Returns all rows from a

New field in django

2013-09-08 Thread Harjot Mann
I am trying to add a new field to model class in django using south but when I am running ./manage.py migrate app, I am getting this error http://202.164.53.122/~harjotmann/southerror -- Harjot Kaur Mann Blog: http://harjotmann.wordpress.com/ Daily Dairy:

Re: custom signup form

2013-09-08 Thread Jonathan Baker
Ah, I missed that you included your model in your original email. You're definitely using a custom User class (anything other than django.contrib.auth.models.User), which explains why it can't find the set_password() method. Which version of Django are you developing with? If you definitely need

Re: custom signup form

2013-09-08 Thread Anil Jangity
No, I am not using the custom user model, but it seems like I should be? (even though, I don't think I am changing anything that requires this). I still have user name as the authenticator. When I subclass UserCreationForm, it was complaining about not having password1 and 2 not in my form.

Re: custom signup form

2013-09-08 Thread Jonathan Baker
Are you using a custom User model? Your code is very similar to the UserCreationForm django.contrib.auth.forms, and you might want to consider at least subclassing it so you can make use of some of its features (like clean_username). On Sun, Sep 8, 2013 at 11:41 AM, Anil Jangity

Re: Complex query

2013-09-08 Thread Nick Apostolakis
On 08/09/2013 08:17 μμ, Yegor Roganov wrote: I'm developing a forum and my db schema is roughly equivalent to the following: class Topic(models.Model): head = models.CharField() body = models.TextField() created = models.DateTimeField(auto_now_add=True) class Post(models.Model):

Re: custom signup form

2013-09-08 Thread Anil Jangity
class SignupForm(forms.ModelForm): class Meta: model = User fields = ["username", "mail", "password"] def clean_password(self): password = self.cleaned_data.get("password") return password def save(self, commit=True): user =

Re: custom signup form

2013-09-08 Thread Jonathan Baker
Can you post your entire SignupForm class? I think a bit more context will help me diagnose. On Sun, Sep 8, 2013 at 11:27 AM, Anil Jangity wrote: > I tried that too earlier. > > I added these to the SignupForm class: > > def clean_password(self): > password =

Complex query

2013-09-08 Thread Yegor Roganov
I'm developing a forum and my db schema is roughly equivalent to the following: class Topic(models.Model): head = models.CharField() body = models.TextField() created = models.DateTimeField(auto_now_add=True) class Post(models.Model): body = models.TextField() topic =

Re: custom signup form

2013-09-08 Thread Anil Jangity
I tried that too earlier. I added these to the SignupForm class: def clean_password(self): password = self.cleaned_data.get("password") return password def save(self, commit=True): user = super(SignupForm, self).save(commit=False)

Re: custom signup form

2013-09-08 Thread Jonathan Baker
You need to run the password through the 'set_password' method of the User class to hash it. See: https://docs.djangoproject.com/en/1.0/topics/auth/#django.contrib.auth.models.User.set_password Hope this helps, JDB On Sun, Sep 8, 2013 at 11:02 AM, Anil Jangity wrote: > New to

custom signup form

2013-09-08 Thread Anil Jangity
New to Django. When I submit a signup form with this, the password is human readable in the database. It seems like it should be hashed? Looking at some Google pages, it seems I need to subclass UserCreationForm. I tried that instead of forms.ModelForm and now it complains my form doesn't have

Re: duplicate entry in django

2013-09-08 Thread Harjot Mann
On Sun, Sep 8, 2013 at 7:07 PM, Babatunde Akinyanmi wrote: > All these questions are best answered with a separate thread for each. Please answer my questions. I want to solve all these problems. I am not getting anything that what should I do first. Please someone help

Re: Django-cms + Wymeditor + Heroku + AWS s3 + Cors

2013-09-08 Thread Dig
I don't think it's a django question. For security reasons, HTTP browser will block access resources in a different site(domain) by AJAX request. You should add Access-Control-Allow-Origin and Access-Control-Allow-Methods headers (response for OPTION request) to declar your willings. On Sep 8,

Django-Registration compatible with 1.5.2?

2013-09-08 Thread Andre Lopes
Hi, I need to user a registration app for Django 1.5.2. I'm a little bit confused on what app to use. Currently django-registration(https://bitbucket.org/ubernostrum/django-registration) is compatible with Django 1.5.2? If not, what app should I use? Best Regards, -- You received this

Forms template renders 'bad' html

2013-09-08 Thread qdinthialand
I'm new to Django, working through the Polls tutorial with the old Test-Driven Django tutorial, where you're looking for specific field names and values and such. Anyway, to keep it short, I noticed this in a Show Page Source: Very awesome Quite awesome

Re: duplicate entry in django

2013-09-08 Thread Babatunde Akinyanmi
On Sun, Sep 8, 2013 at 3:49 AM, Harjot Mann wrote: > On Wed, Sep 4, 2013 at 2:17 PM, Babatunde Akinyanmi > wrote: > > This is usually a side effect of not doing a redirect from the view > > that handles your submitted form. > > > How can I do it? I

Re: duplicate entry in django

2013-09-08 Thread Harjot Mann
On Sun, Sep 8, 2013 at 2:19 PM, Laurent Meunier wrote: > Harjot is right, you are not doing a redirect after you create your object. > Since the browser is not redirected, if you refresh the page the browser > send an other POST (and a new object is created). > If you

Re: Test using different database

2013-09-08 Thread Larry Martell
On Fri, Jul 26, 2013 at 7:45 AM, Antony wrote: > Hi, > > I have two databases on my settings file. One is sqlite and the other is > postgis. It is a big project so some developers use sqllite and a few are > using postgis. > Now, when I try ./manage.py test command,

Re: duplicate entry in django

2013-09-08 Thread Laurent Meunier
On 08/09/2013 04:40, Harjot Mann wrote: On Wed, Sep 4, 2013 at 10:42 AM, Laurent Meunier wrote: Can you show use the source code of the view where you create your entry in the database? Sure. Here is the link to code: http://tny.cz/09090f4c Thanks for the link.

Create and save records through ManyToManyField selection.

2013-09-08 Thread Germán
You need to register the admin classes defined in admin.py. If you don't know how, go over the official tutorial in Django's online docs. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Query executed two times in database (django 1.4, oracle 11g)

2013-09-08 Thread Germán
I'm not familiar with caching internals but perhaps the fact that you are using `raw` has something to do with your problem? -- 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