Re: Django 1.0 and Stdimage does not work

2008-09-23 Thread Iapain
picture = Picture(gallery = gallery, image = request.FILES['image']) Should be picture = Picture(gallery = gallery, image = request.FILES['image'].name) On Sep 23, 4:55 pm, mwebs <[EMAIL PROTECTED]> wrote: > Hello, > I am using Stdimage instead of the native models.ImageField to have > scaling

Re: Master Page Code

2007-09-12 Thread Iapain
Extend your base(master) template and write a context processor for your common data, or pass context varibales into your template. But I'd suggest you to use context processors. On Sep 12, 7:35 pm, [EMAIL PROTECTED] wrote: > I'm a web developer and I'm developing my first application using > Dja

Re: random Unhandled Exceptions

2007-09-11 Thread Iapain
It looks like yet another unicode bug. Could you tell me your Django version. On Sep 12, 9:40 am, "Peter Baumgartner" <[EMAIL PROTECTED]> wrote: > I'm serving a Django site via fcgi with lighttpd. Just recently I've > started getting Unhandled Exception errors (on a blank white page, not > my Dja

Re: Custom_SQL_Method in a Model

2007-09-09 Thread Iapain
You have written a member function to your class, its going to work like charm. But mind it your *baz* doesnt exist in class so you should pass it into your member function. Alternatively see Django custom managers. On Sep 10, 12:27 am, johnny <[EMAIL PROTECTED]> wrote: > I need to define custom

Re: How to add a non database item to a python model

2007-09-04 Thread Iapain
> I want to have a non database item in this model class, which I can > populate in the views. What is the recommended way to do this. its quite simple: myObject.my_item_that_doesnt_exist_in_model = 'my value' #incase of model object --~--~-~--~~~---~--~~ You re

Re: existing tables

2007-09-04 Thread Iapain
> What can I do to reach existing tables ? Use inspectdb or write model class yourself, based on your table. if your table doesnt have "id" field then you might need to override save() and delete() methods --~--~-~--~~~---~--~~ You received this message because yo

Re: How to use Django with 2 legacy databases

2007-09-03 Thread Iapain
> We have a customer management application written in Zope2 which talks > to a sql-ledger database. I'd like to convert this to Django but > would need to talk to two separate postgres databases. Not a problem with Django, multiple dbs are supported > Can I get some comments on the practicalit

Re: UnicodeDecodeError with memcache

2007-08-29 Thread Iapain
> patrickk, I'm not sure what lapain's experience with unicode is, but > please disregard the advice to switch defaultencoding to utf-8. I didnt want this either, but some time you have to toil a bit for debugging. I suggested him to use smart_str in post1, because i am aware of recently merger o

Re: Error adding DateField - 'unicode' object has no attribute 'strftime'

2007-08-28 Thread Iapain
try converting it into string with smart_str --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, s

Re: pycaptcha help needed

2007-08-28 Thread Iapain
try this one http://code.google.com/p/django-captcha/ On Aug 29, 11:12 am, Ani Nair <[EMAIL PROTECTED]> wrote: > Hi... I am using python2.5 with django 0.97 pre on windows xp.I am new > to this and I have to use captcha... I can't find any source. Can > anybody help? Thanking you all... --~--~-

Re: UnicodeDecodeError with memcache

2007-08-28 Thread Iapain
What middleware you are using .. any external middleware? On Aug 28, 12:27 pm, patrickk <[EMAIL PROTECTED]> wrote: > why prefer latin1 over utf-8 (in settings.py)? > > On 28 Aug., 09:12, Iapain <[EMAIL PROTECTED]> wrote: > > > > >>> import sys > &g

Re: changing versions

2007-08-28 Thread Iapain
> So I ran svn update and checked out rev 6022, restarted apache and > unfortunately got an "Internal Server Error" visiting the website. Please look inside apache log > I dont think I am using the correct svn command... > > when im in the .../python2.5/site-packages/django directory, I use > #s

Re: UnicodeDecodeError with memcache

2007-08-28 Thread Iapain
> >>> import sys > >>> sys.getdefaultencoding() > > 'ascii' Try using utf-8, btw it shouldnt be a problem. Lastly try using changing charset to latin1 in your settings.py .. I guess your website is not in english .. or it has some non-ascii char. --~--~-~--~~~---~--~

Re: is 40 MB RAM enough?

2007-08-27 Thread Iapain
> could you run it and check the output. 14.28 MB --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this gr

Re: dynamic links

2007-08-27 Thread Iapain
> i want to make a link in my template dynamic. e.g. I want to click on > a "rubric" that links to a view that displays all the content. I have > the following URL patterns to reach the rubric: /rubric/view and to > reach the content /bullet///view --> the link i > need in the template that rende

Re: is 40 MB RAM enough?

2007-08-27 Thread Iapain
> what is your RAM usage? How did you tweak apache to achieve that? I didnt check RAM usage, but site always work like express instead i did clean coding and tried to optimize my code. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: UnicodeDecodeError with memcache

2007-08-27 Thread Iapain
> UnicodeDecodeError at /spezialprogramme/ > 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in > range(128) try using smart_str, it it doesnt work then use less restrictive decode --~--~-~--~~~---~--~~ You received this message because you are su

Re: is 40 MB RAM enough?

2007-08-27 Thread Iapain
Yes it is, I am running a huge site on webfaction 40 MB, performance wise its excellent. On Aug 27, 7:57 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > Hi, > > I have a site on WebFaction with 40 MB RAM. It is a very small site > in the sense that it is used for administering an organisation

Re: How to fill in a comboField in a form

2007-08-27 Thread Iapain
ComboField takes a list of fields that should be used to validate a value, in that order. >>> f = ComboField(fields=[CharField(max_length=20), EmailField()]) If you just need a dropdown select then use choiceField >>>t = [('test','select')] >>>f = forms.ChoiceField(choices=t) On Aug 23, 4:47 pm

Re: Newforms field for one to many relationship that is similar to edit in line.

2007-06-14 Thread Iapain
Use two forms for your two different model, newforms currently not supporting edit inline. Cheers, D On Jun 14, 10:43 pm, Dannoo <[EMAIL PROTECTED]> wrote: > I have a "Faves" model that has a foreignkey to the User model. > > I need to create a form that works similar to the edit inline fields,

Re: newforms form_for_model defaults by model

2007-06-14 Thread Iapain
Its only available in Developer version! D. On Jun 15, 1:24 am, handsome greg <[EMAIL PROTECTED]> wrote: > Oh, looks like maybe I can do this with a custom metaclass for my > model. I'll just use it to tack on custom formfield() methods to my > _meta.fields list for the model. Make sense? > >

Re: App.objects.get(user='John') error

2007-06-14 Thread Iapain
Of course it'll give you error, suppose your User is class User(models.Model): first_name = models.CharField(maxlength=256) class App(models.Model): user = models.ForeignKey(User, unique=True, editable=False) then use: try: user_exists = Application.objects.get(user__first_name='john')

Re: Captcha module ready for testing

2007-06-14 Thread Iapain
Hi, Nice implementation but dont see any logic to save captcha temporary, you should add option like "nosave" and use cStringIO in that case. Cheers, Deepak On Jun 13, 5:11 pm, MartinWinkler <[EMAIL PROTECTED]> wrote: > Hi all, > > I just uploaded the captcha module I recently mentioned > toht

Re: getting raw SQL queries

2007-03-09 Thread Iapain
Greetings Malcom! I think you are right, is it possible in django to log all SQL statement? Cheers! On Mar 9, 3:57 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-03-09 at 14:50 +0000, Iapain wrote: > > Hello, > > > I am writing a SQL logviewer for sql

Re: getting raw SQL queries

2007-03-09 Thread Iapain
Yes, I think you are right, I suspected that but I tried in middleware too but its still empty. On Mar 9, 3:55 pm, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > Iapain wrote: > > Hello, > > > I am writing a SQL logviewer for sql queries fired by django. If I use > >

getting raw SQL queries

2007-03-09 Thread Iapain
Hello, I am writing a SQL logviewer for sql queries fired by django. If I use below code then i get an empty list of dictionary. from django.db import conneciton from django.conf import settings debug = settings.DEBUG #btw its always True, because i set it to true in my settings.py settings.DEBU