Re: django breaks not null in postgresql?

2005-11-30 Thread Joshua D. Drake
this is my model: class Visitor(meta.Model): title = meta.CharField('Title',maxlength=250) name = meta.CharField('Name',maxlength=100) email = meta.EmailField('Email Id') date = meta.DateField(auto_now_add=True) matter = meta.TextField('Matter') approved = meta.BooleanField('

Re: django breaks not null in postgresql?

2005-11-30 Thread Kenneth Gonsalves
On Thursday 01 Dec 2005 7:25 am, Joshua D. Drake wrote: > >in django, if i want to insert a new record and just give a > > value for the 'name' field and no values for the rest - it gets > > saved. Postgresql should barf saying 'lack of value in xxx > > field violates not null constraint' but it d

generic update_object view help

2005-11-30 Thread Bryan Murdock
I'm using the update_object generic view. My template just loops through the fields like so: {% for field in form.fields %} {{ field.field_name }} {{ field }} {% if field.errors %}*** {{ field.errors|join:", "}}{% endif %} {% endfor %} I have a couple ForeignKeys in my model and those show

Re: django breaks not null in postgresql?

2005-11-30 Thread Joshua D. Drake
Kenneth Gonsalves wrote: hi, i have a table name varchar not null title varchar not null blurb varchar not null in django, if i want to insert a new record and just give a value for the 'name' field and no values for the rest - it gets saved. Postgresql should barf saying 'lack of value in x

Re: E-Commerce / Credit Card Processing

2005-11-30 Thread Joshua D. Drake
Brant Harris wrote: Has anyone dealt with online credit-card processing using Python or Django? Currently my php application uses Verisign's PayFlowPro which supports php quite nicely, a few calls and the payment is sent. I'm looking for a similar solution for Django. We will actually be w

Re: E-Commerce / Credit Card Processing

2005-11-30 Thread Kenneth Gonsalves
On Wednesday 30 Nov 2005 11:29 pm, Brant Harris wrote: > Has anyone dealt with online credit-card processing using Python > or Django? > > Currently my php application uses Verisign's PayFlowPro which > supports php quite nicely, a few calls and the payment is sent. > I'm looking for a similar so

Re: django breaks not null in postgresql?

2005-11-30 Thread Kenneth Gonsalves
On Wednesday 30 Nov 2005 8:13 pm, Nebojša Đorđević - nesh wrote: > On 27-11-2005, at 3:21, Kenneth Gonsalves wrote: > > so how do you prevent that? i dont like to waste code checking > > if all the mandatory fields are filled - i want postgres to do > > that. Looking at the table, there is no ment

Re: Adding a validator a custom manipulator

2005-11-30 Thread bsoltani
yes, it worked. I hadn't seen that part of the model documentation about the automatically called validators. thanks!

Re: inserting multiple images EASILY

2005-11-30 Thread Emanuele
It's just a name for me, but if you think it worth spending time on it I'll try! Cheers, Emanuele

Re: Adding a validator a custom manipulator

2005-11-30 Thread oggie rob
Babak, It shouldn't matter. Take a look at django.core.meta.__init__ manipulator_methods[k[len(MANIPULATOR_FUNCTIONS_PREFIX):]] = v and _reassign_globals(manipulator_methods, new_mod, new_mod.__dict__['AddManipulator']) _reassign_globals(manipulator_methods, new_mod, new_mod.__dict__['ChangeManip

Re: Adding a validator a custom manipulator

2005-11-30 Thread bsoltani
rob, well, i'm doing this in a custom form/view. It's not being done by the site administrator.

Re: Adding a validator a custom manipulator

2005-11-30 Thread oggie rob
Wait, what? I don't think you need to say object.AddManipulator() Just put that method in your model, and go to the admin interface. It should work for both adding and changing an object in the model. -rob

Re: Adding a validator a custom manipulator

2005-11-30 Thread oggie rob
Yes

E-Commerce / Credit Card Processing

2005-11-30 Thread Brant Harris
Has anyone dealt with online credit-card processing using Python or Django? Currently my php application uses Verisign's PayFlowPro which supports php quite nicely, a few calls and the payment is sent. I'm looking for a similar solution for Django.

Re: Adding a validator a custom manipulator

2005-11-30 Thread bsoltani
so: if I add the above method to my model, it is going to get called automatically when i do object.AddManipulator()?

Re: Adding a validator a custom manipulator

2005-11-30 Thread bsoltani
I think I get what your saying... I'm going to check it out and see if it works. The "tech support" here is amazing. You are you guys aren't outsourcing to India?

Re: Adding a validator a custom manipulator

2005-11-30 Thread oggie rob
Hi Babak, I think you can have the cake. Don't mess with CustomManipulators, just add this method into your model: def _manipulator_validate_filefield(self, field_data, all_data): # if file is not the right type #raise validators.ValidationError, 'Please enter a valid file type'

Re: Customising new-admin tags

2005-11-30 Thread oggie rob
Hi Charlie, You should probably put your custom code in the views.py file, and put custom templates under your specified templates directory (the templates should match the URL you are going for). So from what I can gather this would be: 'TEMPLATES/admin/polls/poll/change_form.html' where TEMPLATE

Re: Customising new-admin tags

2005-11-30 Thread Robert Wittams
[EMAIL PROTECTED] wrote: > Hi > > I know this has been talked about before but I'm having real trouble > getting a handle on customising template tags > > What i want to do is alter the admin change list screen to show some > related values. Now the python's easy it's just a couple of lines in >

Re: Adding a validator a custom manipulator

2005-11-30 Thread Adrian Holovaty
On 11/30/05, bsoltani <[EMAIL PROTECTED]> wrote: > I'm trying to validate a file upload field to make sure that the users > uploaded file is of a specific type. I know this can be done with a > custom manipulator (and in turn a custom validator). However, I still > want to be able to use the def

Adding a validator a custom manipulator

2005-11-30 Thread bsoltani
I'm trying to validate a file upload field to make sure that the users uploaded file is of a specific type. I know this can be done with a custom manipulator (and in turn a custom validator). However, I still want to be able to use the default manipulator for my object for the rest of the parts

Re: django breaks not null in postgresql?

2005-11-30 Thread Nebojša Đorđević - nesh
On 27-11-2005, at 3:21, Kenneth Gonsalves wrote: so how do you prevent that? i dont like to waste code checking if all the mandatory fields are filled - i want postgres to do that. Looking at the table, there is no mention of a default value. Can you post your model? It seems to me that you h

Re: Django on Textdrive?

2005-11-30 Thread Nebojša Đorđević - nesh
On 25-11-2005, at 19:42, David Ascher wrote: What setup did you use? Apache/Lighttpd, fcgi/scgi/other? apache/lighttpd with FastCGI Apache is serving media files and doing proxy to lighttpd. I have replicated this setup also on my devel server for testing. --- Nebojša Đorđević - nesh Stud

Re: Exception Location: C:\soft\django_src\django\templatetags\adminmedia.py

2005-11-30 Thread Grigory Fateyev
Hello Kenneth Gonsalves! On Wed, 30 Nov 2005 10:47:38 +0530 you wrote: > > On Wednesday 30 Nov 2005 2:12 am, kmh wrote: > > The work-around is to manually delete any orphaned > > .pyc files such as adminmedia.pyc (or just all .pyc files as they > > will be regenerated as needed). > > better del

Re: Quoting in tables clause

2005-11-30 Thread Russell Keith-Magee
Ah - thanks. I had a poke around in django/core/meta/__init__.py, but managed to miss the definition of quote_only_if_word. Your reply was just enough to point me in the right direction. I've put together a patch that uses smart quoting for the tables clause. It's submitted as ticket #967. Howev

Re: Quoting in tables clause

2005-11-30 Thread hugo
>1) Is the quoting behaviour a feature or a bug? (I suspect feature, but >I thought I'd check) Yep, it is. The reason are different handlings of reserved words. Your column names might conflict with stuff defined by the SQL database and by quoting the names this conflict doesn't arise. >2) Is th

Customising new-admin tags

2005-11-30 Thread [EMAIL PROTECTED]
Hi I know this has been talked about before but I'm having real trouble getting a handle on customising template tags What i want to do is alter the admin change list screen to show some related values. Now the python's easy it's just a couple of lines in items_for_results in admin_list.py probl

Re: inserting multiple images EASILY

2005-11-30 Thread Emanuele
Thanks for your solution. For my case it is still a bit too complicate for users (my users, I mean). Anyway it really cool! Emanuele

Re: inserting multiple images EASILY

2005-11-30 Thread Kenneth Gonsalves
On Wednesday 30 Nov 2005 3:32 pm, Emanuele wrote: > Some friend sent me this advice for the problem: "webdav"; but > for me it is just a buzzword :) . I'll investingate this webdav > too. more than a buzzword - zope makes extensive use of webdav -- regards kg http://www.livejournal.com/users/l

Re: inserting multiple images EASILY

2005-11-30 Thread Emanuele
You got it. No misunderstanding. Images are on the client side and the web-app needs them on the server side in order to be associated with data in the form. The idea of having a client app to upload images is interesting. I'll look for it. Some friend sent me this advice for the problem: "webdav

Re: inserting multiple images EASILY

2005-11-30 Thread Maniac
Waylan Limberg wrote: I imagine that is why online photo services (flickr) offer client side apps for batch uploading etc. Another way is to accept zip archives with pictures as a single file. But it assumes rather educated users. I'm currently doing such a service myself and for internet u