S3Storage.py and Thumbnails using PIL (IOError / cannot identify image file)

2008-12-19 Thread Merrick
I setup S3Storage as my default storage and can successfully upload images to S3 without overriding save on my profile_update below. Right now, when I submit a form with an image I get the original image uploaded in my S3 bucket not a thumbnail and an IO Error - "cannot identify image file" -

newie, django and apache, somethings are not working

2008-12-19 Thread jjgarsal
Finally I finish the tutorial at http://docs.djangoproject.com/en/dev/intro/tutorial04/#intro-tutorial04 the example completly work on the WebServer test (the admin, questions and the polls, everything). Then when I tried to execute the application at apache server (I install mod_python, etc.)

cross table querying

2008-12-19 Thread Shuge Lee
# mysql.sql CREATE TABLE IF NOT EXISTS `os` ( `id` int(11) NOT NULL auto_increment, `name` varchar(64) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; INSERT INTO `os` (`id`, `name`) VALUES (1, 'All'), (2, 'Windows'), (3,

Re: Putting tests in a tests folder

2008-12-19 Thread Russell Keith-Magee
On Fri, Dec 19, 2008 at 11:32 PM, Martin Lundberg wrote: > Hello everyone! > > What do I need to do to be able to put my tests in a folder (called "tests") > inside my application folders and make django run them? > > I want something like: > >

ascii or unicode,

2008-12-19 Thread mono
I am a newbie, and I try to use tags, this is a example in djangoproject class CurrentTimeNode3(template.Node): def __init__(self, format_string, var_name): self.format_string = format_string self.var_name = var_name def render(self, context):

conditional fields in template

2008-12-19 Thread bobuva
I have a page that is created using a template and the Django forms module. A user gets to the page from one of two links. A few of the fields on the form (on page) are only shown when the user goes from one of the links. If I do this without using the forms module, I can pass a query string

Re: Help with batch processing

2008-12-19 Thread Brandon Taylor
I've been looking at the methods from those libs. Glad to know I'm on the right track. Thanks, b On Dec 19, 7:27 pm, Masklinn wrote: > On 19 déc. 08, at 23:50, Brandon Taylor   > wrote: > > > Hi everyone, > > > My client needs some batch

Re: Help with batch processing

2008-12-19 Thread Masklinn
On 19 déc. 08, at 23:50, Brandon Taylor wrote: > Hi everyone, > > My client needs some batch processing capabilities that I haven't > coded in Python/Django yet, and I need advice on the best way to read > images contained in a .zip file. I'm pretty comfortable

Query using actual table values

2008-12-19 Thread Andrew Fong
I'm looking for the Django equivalent of the following: SELECT * FROM table WHERE table.x1 = table.x2 Pretty sure someone has asked this before but I had a hard time finding anything. I don't really want to write raw SQL if it can be avoided.

Re: PREPEND_WWW

2008-12-19 Thread jmat
It did fix my issue..hopefully this is helpful to anyone else running into this On Dec 15, 4:47 pm, "Craig Kimerer" wrote: > Yes, this was fixed post 1.0 release.  If you upgrade to 1.0.2 it may fix > your problem. > > Craig > > On Mon, Dec 15, 2008 at 4:04 PM, jmat

Re: MySpace clone using Django? Is it possible?

2008-12-19 Thread j...@zigzap.com
Other comments aside, it really depends on your budget and exactly how "customized" or different this going to be from other social networking sites. If your not planning on spending more than 10K for the development of the site, you are going to be hard pressed to find any decent developers

Django Session Variables

2008-12-19 Thread j...@zigzap.com
Does django maintain session variables when logging in or does it generate a new session when you use the built in authentication. Essentially I want to be able to assign session values to an Anonymous User and be able to carry them through when they log in.

Help with batch processing

2008-12-19 Thread Brandon Taylor
Hi everyone, My client needs some batch processing capabilities that I haven't coded in Python/Django yet, and I need advice on the best way to read images contained in a .zip file. I'm pretty comfortable extending Django admin, just not working with files this way. I will need to: 1. Read and

Re: Limiting HTTP request size

2008-12-19 Thread Graham Dumpleton
On Dec 20, 12:48 am, Andreas Gustafsson wrote: > What's the recommended way to protect a Django application against > denial of service via huge file uploads or  huge POST requests in > general?  If I set the LimitRequestBody option in the Apache > configuration file, mod_python

Re: custom widgets

2008-12-19 Thread nbv4
On Dec 19, 3:34 pm, Daniel Roseman wrote: > On Dec 19, 8:11 pm, nbv4 wrote: > > > I have a model with a field called date_format. That field is an > > integer value from 1 to 9 corresponding to "D m-j-y", "m-d-Y", etc. I > > have the model

Re: filter_horizontal in inlines

2008-12-19 Thread jhill10110
never mind, I didn't realize you could just add a filter_horizontal to the InlineModelAdmin object: class ProductCustomAttribute_Inline(admin.StackedInline): model = ProductCustomAttribute max_num = 1 extra = 1 formset = ProductCustomAttributeFormSet filter_horizontal =

Re: Problem saving a User object to a profile

2008-12-19 Thread DragonSlayre
Actually, it seems a bit redundant doesn't it? I see there is a get_profile, but nothing to set it anyway. I guess it's derived information from the database Yay! such simple solutions, I'm so happy to be able to register. On Dec 20, 9:42 am, DragonSlayre wrote: > You

Re: Problem saving a User object to a profile

2008-12-19 Thread DragonSlayre
You are gods - thank you. I did try something like this before, but being so noob at the technology, didn't assign the form to a new variable. Will i have to assign the profile in the user object as well? I assume I will. On Dec 20, 9:38 am, Daniel Roseman

Re: MySpace clone using Django? Is it possible?

2008-12-19 Thread Daniel Roseman
On Dec 19, 7:45 pm, "James Bennett" wrote: > On Fri, Dec 19, 2008 at 12:41 PM, lekvar...@gmail.com > > wrote: > > Hi, I wanna know wich of the well known frameworks is the best choice > > for myspace-clone community website. > > Since you're basically

Re: Problem saving a User object to a profile

2008-12-19 Thread nbv4
On Dec 19, 3:15 pm, DragonSlayre wrote: > profile_form.user = user; > profile_form.save() The problem is that you can't assign fields in forms directly like this. The only way to input data into a form is when you initially create the form object ala: profile_form =

Re: Problem saving a User object to a profile

2008-12-19 Thread Daniel Roseman
On Dec 19, 8:28 pm, nbv4 wrote: > On Dec 19, 3:15 pm, DragonSlayre wrote: > > > profile_form.user = user; > > profile_form.save() > > The problem is that you can't assign fields in forms directly like > this. The only way to input data into a form is when

Re: Problem saving a User object to a profile

2008-12-19 Thread Adi Sieker
Hi, On 19.12.2008, at 21:15, DragonSlayre wrote: > > I've got a profile model which has a django.contrib.auth.models.User > as a foreign key. > > I am trying to assign the User object to my profile model after I've > checked that the user is valid and that the profile contents are also > valid.

Re: custom widgets

2008-12-19 Thread Daniel Roseman
On Dec 19, 8:11 pm, nbv4 wrote: > I have a model with a field called date_format. That field is an > integer value from 1 to 9 corresponding to "D m-j-y", "m-d-Y", etc. I > have the model defined with a 'choices' set so the database can store > the number, and a dropdown is

filter_horizontal in inlines

2008-12-19 Thread jhill10110
Is it possible to select some fields in an inlines attribute to be displayed using the filter_horizontal filter? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Problem saving a User object to a profile

2008-12-19 Thread DragonSlayre
Ok - I'm digging deeper, and I realise that my form doesn't have a user, as it's excluded from the form using exclude = ('user'). I'll carry on looking... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Problem saving a User object to a profile

2008-12-19 Thread DragonSlayre
I've got a profile model which has a django.contrib.auth.models.User as a foreign key. I am trying to assign the User object to my profile model after I've checked that the user is valid and that the profile contents are also valid. Once I've saved my user object, I then call profile_form.user

custom widgets

2008-12-19 Thread nbv4
I have a model with a field called date_format. That field is an integer value from 1 to 9 corresponding to "D m-j-y", "m-d-Y", etc. I have the model defined with a 'choices' set so the database can store the number, and a dropdown is created with the choices instead of just a textbox field. The

Django + non-parseable headers

2008-12-19 Thread Alexey Moskvin
Is it possible to send responce with non-parseable header from django app? afaik, my hoster support it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: MySpace clone using Django? Is it possible?

2008-12-19 Thread Jeffrey Johnson
Or just start with something like pinax http://pinaxproject.com/ and then figure out what it is that will make your site 'special' or 'different' from what you are cloning ... or just go on a vacation as James suggests. Jeff On Fri, Dec 19, 2008 at 11:45 AM, James Bennett

Re: MySpace clone using Django? Is it possible?

2008-12-19 Thread Juan Hernandez
yes! go to the bahamas ;) On Fri, Dec 19, 2008 at 2:45 PM, James Bennett wrote: > > On Fri, Dec 19, 2008 at 12:41 PM, lekvar...@gmail.com > wrote: > > Hi, I wanna know wich of the well known frameworks is the best choice > > for myspace-clone

Re: MySpace clone using Django? Is it possible?

2008-12-19 Thread James Bennett
On Fri, Dec 19, 2008 at 12:41 PM, lekvar...@gmail.com wrote: > Hi, I wanna know wich of the well known frameworks is the best choice > for myspace-clone community website. Since you're basically going to be throwing money away no matter what ("cloning" an established player

Re: Is this a bug in FormWizard?

2008-12-19 Thread 朱穆穆
self.extra_context is a reference of FormWizard.extra_context. It was empty when the class define, but may not empty when instantiate. class TestWizard(forms.FormWizard): pass tw1 = TestWizard() tw1(request, extra_context={'test1': 1}) # tw1.extra_context is {'test1': 1} tw2 = TestWizard()

reverse foreign key lookup in extra()

2008-12-19 Thread Fereshteh
Hi, I am trying to add a filtering functionality to my web application. I create a WHERE clouse text in the client side as text and post it to the server. My Django modele lookes like this: class Projects(models.Model): id = models.AutoField(primary_key=True) name = models.TextField()

reverse foreign key lookup in extra()

2008-12-19 Thread Fereshteh Amini
Hi, I am trying to add a filtering functionality to my web application. I create a WHERE clouse text in the client side as text and post it to the server. My Django modele lookes like this: class Projects(models.Model):     id = models.AutoField(primary_key=True)     name = models.TextField()   

MySpace clone using Django? Is it possible?

2008-12-19 Thread lekvar...@gmail.com
Hi, I wanna know wich of the well known frameworks is the best choice for myspace-clone community website. CakePHP ? Zend Framework? Symfony? Django :)? RubyOnRails? or maybe Kohana? Prado? or something else? Is it better to use PHP or Ruby or Python? I will pay a webdesigner for this job, but

Re: PDF creation!!!

2008-12-19 Thread redmonkey
If you just want images of data, Google charts might be useful: http://code.google.com/apis/chart/ I imagine you could get Google to generate a .jpg for you and put the in a .pdf if you need to print it. Furthermore, if it is fancy grphs you want, Google Visualisations could work even better:

Re: Restricting add in the admin

2008-12-19 Thread Peter
> > >  What I was looking for was a global permission that could be set on a > >  model when it was defined which set > >  default permissions for 'staff' on the model (or even for superuser) > >  on that model. > > Why not just create another group? Because being a singleton (and not removable)

Re: Delete multiple items from an admin change list

2008-12-19 Thread Jeff Kowalczyk
On Dec 19, 6:15 am, bcurtu wrote: > Is it possible to get the admin item list with a kind of checkboxes in > order to select multiple items and delete them all together? http://code.google.com/p/django-batchadmin/ --~--~-~--~~~---~--~~ You

Re: ANN: Softwarefabrica Django CRUD (PRE-RELEASE)

2008-12-19 Thread panta
On Dec 19, 4:18 pm, walterbyrd wrote: > Seems promising. Can I make a request/suggestion? Maybe you should > consider putting together a screencast, or a series of slides (I > happen to prefer slides) as a demo? Sometimes, a few graphics can be > worth a thousand words.

Re: ANN: Softwarefabrica Django CRUD (PRE-RELEASE)

2008-12-19 Thread walterbyrd
Seems promising. Can I make a request/suggestion? Maybe you should consider putting together a screencast, or a series of slides (I happen to prefer slides) as a demo? Sometimes, a few graphics can be worth a thousand words. --~--~-~--~~~---~--~~ You received this

Re: Putting tests in a tests folder

2008-12-19 Thread panta
On Dec 19, 3:32 pm, "Martin Lundberg" wrote: > Hello everyone! > > What do I need to do to be able to put my tests in a folder (called "tests") > inside my application folders and make django run them? > > I want something like: > > /project/app1/tests/module_tests.py

Re: Putting tests in a tests folder

2008-12-19 Thread Daniel Roseman
On Dec 19, 2:32 pm, "Martin Lundberg" wrote: > Hello everyone! > > What do I need to do to be able to put my tests in a folder (called "tests") > inside my application folders and make django run them? > > I want something like: > > /project/app1/tests/module_tests.py

Re: Restricting add in the admin

2008-12-19 Thread James PIC
On 12/19/08, Peter wrote: > > > > > > You could make such a check and deny the saving of a new FrontPage > > object by overloading the save() method of class FrontPage. > > Source in trunk: django/db/models/base.py. > > > > Regards, James. > > > Thanks James. > > Yes

Putting tests in a tests folder

2008-12-19 Thread Martin Lundberg
Hello everyone! What do I need to do to be able to put my tests in a folder (called "tests") inside my application folders and make django run them? I want something like: /project/app1/tests/module_tests.py /project/app1/tests/module2_tests.py /project/app2/tests/module_tests.py

Re: Limiting HTTP request size

2008-12-19 Thread Abdel Bolanos Martinez
my friend i can suggest write a custom FileUploadHandler and improve the method receive_data_chunk(self, raw_data, start) and check the data that comes into your server, search in the documentation about write a custom FileUploadHandler, if need more help write now!!! On Fri, 2008-12-19 at

Re: Security in AJAX POSTing

2008-12-19 Thread Taylor
Oh awesome! I didn't know that, and yes it helps a lot! I suppose I could compliment this with the request.is_ajax() and I'm all set. Thanks again! Taylor On Dec 19, 5:47 am, Srdjan Popovic wrote: > Taylor, > > If you are worried about POST data submitted

Re: Restricting add in the admin

2008-12-19 Thread Peter
> > You could make such a check and deny the saving of a new FrontPage > object by overloading the save() method of class FrontPage. > Source in trunk: django/db/models/base.py. > > Regards, James. Thanks James. Yes - I see that would work - but it involves coding and I was looking for a more

Re: PDF creation!!!

2008-12-19 Thread panta
On Dec 19, 2:21 pm, Abdel Bolanos Martinez wrote: > Please can any one give me good references about tools for create PDF > reports, graphs in Django besides RepoLab > > thanks Hi Abdel, give a look at XHTML2PDF: http://www.htmltopdf.org/ See also:

Re: Restricting add in the admin

2008-12-19 Thread James PIC
On 12/19/08, Peter wrote: > > I have two models in my app - one is standard in that it allows > changing existing records/instances and adding new ones. But the other > - actually a FrontPage model - does not permit adding another > instance. There are ways to do this

Limiting HTTP request size

2008-12-19 Thread Andreas Gustafsson
What's the recommended way to protect a Django application against denial of service via huge file uploads or huge POST requests in general? If I set the LimitRequestBody option in the Apache configuration file, mod_python throws an ominous-looking exception when the limit is exceeded:

messages and notifications app problem.

2008-12-19 Thread mtnpaul
First I installed the messages application and everything worked pretty well (emails got sent, messages got sent). But according to the docs I should have notifications installed. Now no emails get sent out. Any ideas what I'm doing wrong. I have put in the urls path for notifications, and I put

Re: SyncDB failure

2008-12-19 Thread James PIC
On 12/17/08, Russell Keith-Magee wrote: > > On Wed, Dec 17, 2008 at 9:30 PM, James PIC wrote: > > > > Is it worth reporting the bug? > > However, at a guess, I'm going to say that the problem has been caused > by your choice of model names. You

PDF creation!!!

2008-12-19 Thread Abdel Bolanos Martinez
Please can any one give me good references about tools for create PDF reports, graphs in Django besides RepoLab thanks Abdel Bolaños Martínez Ing. Infórmatico Telf. 266-8562 5to piso, oficina 526, Edificio Beijing, Miramar Trade Center. ETECSA

ANN: Softwarefabrica Django CRUD (PRE-RELEASE)

2008-12-19 Thread Marco Pantaleoni
Softwarefabrica Django CRUD (sfcrud) is a free, Open Source, advanced generic views library for Django. Its main features are: - generic views are a backward-compatible drop-in replacement for those offered by django - generic views by default use the advanced features (widgets, template-based

rendering single form fields in a template

2008-12-19 Thread Dennis Schmidt
Hello, normally you could render a simple formset like this: {% for form in formset.forms %} {% for field in form %} {{ field }} {% endfor %} {% endfor %} Now my problem is, that I can't use the second for loop since I need direct access to every single formfield. This is because my

Restricting add in the admin

2008-12-19 Thread Peter
I have two models in my app - one is standard in that it allows changing existing records/instances and adding new ones. But the other - actually a FrontPage model - does not permit adding another instance. There are ways to do this but I am wondering if there is a standard way as it seems a

Delete multiple items from an admin change list

2008-12-19 Thread bcurtu
Is it possible to get the admin item list with a kind of checkboxes in order to select multiple items and delete them all together? Cheers --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: nested template problem

2008-12-19 Thread marco ghidinelli
On Thu, Dec 18, 2008 at 11:42:19AM -0800, bruno desthuilliers wrote: > > i'm trying to display a nested array with no luck. > > > > that's my tries: > > > > --- python manage.py shell --- > > from django.template import Template, Context > > list_parts = { > >

Re: Security in AJAX POSTing

2008-12-19 Thread Srdjan Popovic
Taylor, If you are worried about POST data submitted through Ajax request coming from another site, you should remember that browsers do not allow XMLHttpRequest to be sent to other domains. Having said that, you can still use the CSRF middleware for your non-Ajax requests. A couple of

Re: passing extra parameters with named urls

2008-12-19 Thread Masklinn
On 19 Dec 2008, at 00:00 , DragonSlayre wrote: > url(r'^register/$', > register, > {'extra_context' : {'currentmaintab' : > 'account'}}, > name='registration_register', > ), > Good now you know

Re: SQLite iexact problem with non-latin symbols

2008-12-19 Thread Eugene Mirotin
Thank you for the detailed answer. I'll investigate the question about pysqlite (http:// oss.itsystementwicklung.de/trac/pysqlite/changeset/361 looks promosing), but switching to other DB is OK, though SQLite is much more convenient for development and debugging as I work on the project from

Re: django and os.spawnvp method

2008-12-19 Thread Alan
Thanks Karen. Sorry, I got it. I read the conversation you've sent. Pretty interesting and the approach suggested by Russell definitely can work but it will impose others limitations to me. I need to track the PID of the submitted process. I have to think more about how to do it with cron. So,

Re: output of XML serializer

2008-12-19 Thread bruno desthuilliers
On 19 déc, 00:13, "Mr. T" wrote: > response = serializers.serialize('xml', MySet.objects.all()) > return HttpResponse(response , mimetype='text/xml;') > > The output has each member of "MySet" with an tag, and then > within the object, a bunch of tags with each field.

Re: how to add more params in url

2008-12-19 Thread mono
thanks On 12月19日, 下午12時28分, cschand wrote: > check this snippet > > http://www.djangosnippets.org/snippets/840/ > > Satheesh > > On Dec 19, 9:05 am, mono wrote: > > > I means if I have three param( I think it is very frequent ), the > > style of