Re: Image Field Issue

2011-10-23 Thread Swaroop Shankar V
Thanks Kurtis, I figured out that was the issue. I downloaded a copy of PIL from their official site. Installed the devel libraries for libjpeg and then did a setup.py install and now its fixed :) Regards, Swaroop Shankar V On Mon, Oct 24, 2011 at 11:32 AM, Kurtis Mullins wrote: > Django relie

Re: Image Field Issue

2011-10-23 Thread Kurtis Mullins
Django relies on Python Imagine Library to check if an image is valid or not. Make sure that PIL was compiled w/ the libjpeg. I'm not sure on exact directions on how to do that, but you can find them available online. When you compile PIL, it will tell you what extensions are supported or missing d

Re: Image Field Issue

2011-10-23 Thread Swaroop Shankar V
Hello All, An update to my previous question. The error occurs only if I try to upload jpeg images, other formats like gif, png do not have this issue. Please let me know if there is any extension that i need to install to support jpeg. Please note that mine is a linux machine (Opensuse 11.3). Than

Re: model: how to reference to the model itself?

2011-10-23 Thread Mike Dewhirst
On 24/10/2011 4:00pm, Mike Dewhirst wrote: On 24/10/2011 3:47pm, Ken wrote: I want to create a parent-child like catalog system. from django.db import models class Catalog(models.Model): username = models.EmailField() name = models.CharField(max_length=64) color = models.CharField(max_length=2

Re: model: how to reference to the model itself?

2011-10-23 Thread Mike Dewhirst
On 24/10/2011 3:47pm, Ken wrote: I want to create a parent-child like catalog system. from django.db import models class Catalog(models.Model): username = models.EmailField() name = models.CharField(max_length=64) color = models.CharField(max_length=20) state = models.Intege

Re: model: how to reference to the model itself?

2011-10-23 Thread Ken
oh, I found the answer: use ForeignKey('self') to a many-to-one ref to model self please ignore my former post. >_< On 10月24日, 下午12时47分, Ken wrote: > I want to create a parent-child like catalog system. > > from django.db import models > > class Catalog(models.Model): > username = models.Em

model: how to reference to the model itself?

2011-10-23 Thread Ken
I want to create a parent-child like catalog system. from django.db import models class Catalog(models.Model): username = models.EmailField() name = models.CharField(max_length=64) color = models.CharField(max_length=20) state = models.IntegerField() parentcatalog = models.Man

Image Field Issue

2011-10-23 Thread Swaroop Shankar V
Hello All, I am having a trough time with the Image Field. I am trying to upload an image and even if i upload a valid image, the form validator throws an error "Upload a valid image. The file you uploaded was either not an image or a corrupted image.". I have verified that PIL is installed in my

Re: custom queryset with calculated field

2011-10-23 Thread dr.phil
Somehow I have itworking without any custom managers or querysets. The last issue was fixed by importing simplejson instead of json. Thanks for all the help On Oct 23, 5:05 pm, "dr.phil" wrote: > I narrowed down the error. Strang thing is this works in a shell but > not in my app. > > import dat

How do I set an instance? (Model -> ModelForm -> FormView)

2011-10-23 Thread Kurtis
Hey, I have a Model, a ModelForm (that does other custom stuff aside from just editing the Model) and a FormView. Everything works great for creating the Model and running my custom logic to do other things. I'm trying to create an Edit/Update View now. I tried looking at UpdateView as mentioned

Re: DJango for large-scale e-commerce: A good or bad choice?

2011-10-23 Thread Russell Keith-Magee
On Sun, Oct 23, 2011 at 6:45 PM, Alec Taylor wrote: > Good afternoon, > > I'm looking at all the notable CMSs and web-frameworks across any > language (C++, Ruby, Python, Perl, .NET, PHP), for an e-commerce > solution which suits my project. > > Basically I'm creating an e-commerce store of e-comm

Viewing file-upload in django admin site. How to do it?

2011-10-23 Thread Satyajit Sarangi
This is my models.py from django.db import models # Create your models here. class Question(models.Model): question_name = models.CharField(max_length=200) question_type = models.CharField(max_length=20) def __unicode__(self): return self.question_name c

Re: Piston XML Attributes

2011-10-23 Thread Guy Nesher
Thanks On Oct 23, 9:17 pm, Masklinn wrote: > On 2011-10-23, at 21:20 , Guy Nesher wrote:> Hi, > > > I've started playing with Piston several days ago but I'm unable to > > create XML attributes. > > Do I need to create a special emitter for that ? > > From what I can read in the XMLEmitter code,

Re: custom queryset with calculated field

2011-10-23 Thread dr.phil
I narrowed down the error. Strang thing is this works in a shell but not in my app. import datetime from django.utils import simplejson as json from django.core.serializers.json import DjangoJSONEncoder queryset = {"sColums" : "time", "aaDAta" : "[(datetime.datetime(2011, 10, 19, 17, 18, 2))]"} j

Re: Piston XML Attributes

2011-10-23 Thread Masklinn
On 2011-10-23, at 21:20 , Guy Nesher wrote: > Hi, > > I've started playing with Piston several days ago but I'm unable to > create XML attributes. > Do I need to create a special emitter for that ? >From what I can read in the XMLEmitter code, I would think so yes: Piston's >built-in XMLEmitter m

Piston XML Attributes

2011-10-23 Thread Guy Nesher
Hi, I've started playing with Piston several days ago but I'm unable to create XML attributes. Do I need to create a special emitter for that ? Guy -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

Re: Storage Backend for MediaTemple's ProCDN?

2011-10-23 Thread Mark Hughes
On 22 October 2011 22:11, Kevin wrote: > I have a client who is suggesting that I look into MediaTemple's > ProCDN.  I currently only have experience with RackSpace's CloudFiles > CDN, and only know of it and Amazon S3 for django storage support. > Furthermore, I cannot seem to access their API pa

Setting default values in a form from DB table

2011-10-23 Thread Swaroop Shankar V
Hello All, I am trying to create a Edit form to edit user information. I would like to display the default values in the form fields rendered and am getting the values from the db table. I can take an approach by creating a dictionary with the values that needs to be populated in the form fields i

update database by phpmyadmin

2011-10-23 Thread Alfredo Alessandrini
Hi, I'm trying to import a big database in the django project by phpmyadmin. The import process is successful. The database by phpmyadmin and mysql admin is ok. If I try to make some query by python shell it work. But the problem is that the database isn't showed in the admin panel. (I've resta

redirect problems

2011-10-23 Thread nicolas HERSOG
Hi everyone, I'm stuck with the redirection in django. This is my url.py (r'^article/(?P\d+)/$', 'myapp.myappFront.views.article'), (r'^article/(?P\d+)/addComment/$', 'myapp.myappFront.views.addComment'), I developed a little view in order to add comment to my article, this is my view.p

Re: custom queryset with calculated field

2011-10-23 Thread Casey Greene
What is the error that that function gives you? It may be possible to just fix that function. Casey On 10/23/2011 07:42 AM, dr.phil wrote: The reason for this exercise is to produce suitable output for the jquery plugin datatables. I am trying to use the following code http://rus.hk/django-d

Excel Import Generic Relations

2011-10-23 Thread stephenstubbs
We have created an excel import application called cute_import at https://bitbucket.org/darrenma/django-cuteimport which is able to create and update records based on an excel spreadsheet. This works well for one model currently. Currently it imports foreign keys based on how they are matched up us

not so Django problem. more like fastcgi problem

2011-10-23 Thread Alexandr Notchenko
I got a problem with my Django+fcgi+Nginx setup on VMware virtual machine with “ubuntu server 11.04” my #urls.py from django.conf.urls.defaults import patterns, include, url from sitename.views import hello, my_homepage_view urlpatterns = patterns('', (r'^$', my_homepage_view),

Re: How to add extra fields to User table

2011-10-23 Thread Yok Keen Hui
I think its simply easier to use AUTH profile to write a model for the additional info that you want and add as an inline to the user admin. Remember to unregister user in admin before registering user again under admin.py, otherwise the inline will not show up in the user page. On Sun, Oct 23, 20

Djano 1.4 SimpleListFilter 'selected' option issue

2011-10-23 Thread tejinderss
I have written a SimpleListFilter, here is the code: http://dpaste.com/639578/ It displays in the admin list properly, but i am having an issue, The selected option does not get highlighted in the custom filter. Only 'All' highlights but not the custom options. Here is the screenshot to illustrate

Re: DJango for large-scale e-commerce: A good or bad choice?

2011-10-23 Thread Carlos Leite
> I'm looking at all the notable CMSs and web-frameworks across any > language (C++, Ruby, Python, Perl, .NET, PHP), for an e-commerce > solution which suits my project. Which language are most comfortable ? Python is great, easy, elegant, and even for non hard programmers, its easy to maintain. >

Re: How to filter arithmetic seires in loop?

2011-10-23 Thread mitesh.patel1119
-- Sent via Nokia Email --Original message-- From: Russell Keith-Magee To: Date: Sunday, October 23, 2011 4:06:08 PM GMT+0800 Subject: Re: How to filter arithmetic seires in loop? On Sun, Oct 23, 2011 at 3:58 PM, Tsung-Hsien wrote: > Thanks your advice! > However,using {% if

Re: custom queryset with calculated field

2011-10-23 Thread dr.phil
The reason for this exercise is to produce suitable output for the jquery plugin datatables. I am trying to use the following code http://rus.hk/django-data-parser-for-jquery-datatable/ There are no problems until I include a datetime field. Then 'datatabilize' fails because it cannot jsonify a d

Re: CSRF verification failed. Request aborted.

2011-10-23 Thread ch3ka
On Sat, 22 Oct 2011 20:32:02 +0100 Kayode Odeyemi wrote: > On Sat, Oct 22, 2011 at 9:40 PM, wrote: > > Drupal cannot know about the CSRF token it has to send. > > > > You'd need to disable the CSRF-Check for that view. > > You can use the csrf_exempt decorator for example, found in the > > django

DJango for large-scale e-commerce: A good or bad choice?

2011-10-23 Thread Alec Taylor
Good afternoon, I'm looking at all the notable CMSs and web-frameworks across any language (C++, Ruby, Python, Perl, .NET, PHP), for an e-commerce solution which suits my project. Basically I'm creating an e-commerce store of e-commerce stores. So for all e-commerce stores integrated with this sy

Re: How to add extra fields to User table

2011-10-23 Thread Santiago Basulto
I'm new with Django, but i've used AUTH_PROFILE_MODULE = 'accounts.UserProfile' and works great to me. It's really simple to work with it, becouse everywhere you have a auth.User you can issue a get_profile() and get your UserProfile. On Oct 23, 4:52 am, Chen Xu wrote: > Hi, Every one: > I am tr

Re: Storage Backend for MediaTemple's ProCDN?

2011-10-23 Thread Kurtis Mullins
I'm glad to hear you're having better luck with Rackspace than we did! Cumulus worked great for things like User Uploaded Media -- but when it came to things like Static Media (specifically using django's collectstatic feature) we had issues. Given, we could have just spent more time on the situati

Re: Storage Backend for MediaTemple's ProCDN?

2011-10-23 Thread Kevin
Thanks for your input. I currently use Rackspace's CDN, their cloudfiles. So far it works nicely with django using the cumulus storage backend. Cumulus supports virtual directories in a container, and for the most part works. I have not yet tried Amazon's S3, as currently all my services includ

Re: Django as a Standalone Desktop Application

2011-10-23 Thread Chandrakant Kumar
On 10/23/2011 07:02 AM, Alex Mandel wrote: On 10/21/2011 07:35 PM, kenneth gonsalves wrote: On Sat, 2011-10-22 at 00:02 +0200, Ivo Brodien wrote: I think with django this is an easy tast. This might loos like a typical Excel/VBA and maybe Word thing, but I don’t want to use non open source sof

Re: How to filter arithmetic seires in loop?

2011-10-23 Thread Russell Keith-Magee
On Sun, Oct 23, 2011 at 3:58 PM, Tsung-Hsien wrote: > Thanks your advice! > However,using {% if forloop.counter % 4 == 1 %} shows problem that > Exception Value: > Could not parse the remainder: '%' from '%' > Now, I refer > http://stackoverflow.com/questions/1438486/how-to-use-math-remainder-in-

Re: How to filter arithmetic seires in loop?

2011-10-23 Thread Tsung-Hsien
Thanks your advice! However,using {% if forloop.counter % 4 == 1 %} shows problem that Exception Value: Could not parse the remainder: '%' from '%' Now, I refer http://stackoverflow.com/questions/1438486/how-to-use-math-remainder-in-django-template and change it to {%forloop.counter|add:"-1"|divis

How to add extra fields to User table

2011-10-23 Thread Chen Xu
Hi, Every one: I am trying to create a user registration form. The default of User table has limited number of fields, but I want to add more into it. Therefore, I am wondering what is the better way to do it? Creating another UserProfile class, and adding "AUTH_PROFILE_MODULE = account.UserProfil

form.is_valid() changes a ModelForm's associated instance

2011-10-23 Thread Torsten Bronger
Hallöchen! I was bitten by this behaviour today, so I'd like to revisit an old subject: See . If I give an "instance" to a model form constructor and later on call ".is_valid()" on that form, the given instance is changed in place.

Re: How to do string operations in Templates?

2011-10-23 Thread Russell Keith-Magee
On Sun, Oct 23, 2011 at 10:18 AM, Lee wrote: > New to template language. I've perused the docs but can't find how to > do basic string operations like regex match/replace on {{ string > variables }} within a template. Can someone please steer me to the > right docs? The reason you haven't found a

Re: How to filter arithmetic seires in loop?

2011-10-23 Thread Russell Keith-Magee
On Sun, Oct 23, 2011 at 12:37 PM, Tsung-Hsien wrote: > I want to filter a loop when the number comes to 1,5,9,13,17... > I use this but fail > {% if forloop.counter |divisibleby range(1,100,4)%}{% endif %} > How to fix it, thanks a lot !! Firstly, your stated problem definition -- identifying whe