Re: Processing multiple forms on one page

2009-06-24 Thread Ian Lewis
Oleg, You can set a parameter in your post request that allows you to differentiate between the two POST requests. But a more clean approach would be to just have the different forms POST to different urls(views) and the redirect back to the profile page if there is an error or do whatever. Ian

Re: Odd ModelForm problem

2009-06-24 Thread Ian Lewis
I'm not sure why it might work on one server but not on another unless the version of Django was different but as far as I know form.slug is not really guaranteed to exist. Normally it gets added to form.fields or somesuch by the forms metaclass. The actual data from the post request should also n

Re: how to run just ONE test?

2009-06-24 Thread Russell Keith-Magee
On Mon, Jun 22, 2009 at 8:50 PM, patrickk wrote: > > unfortunately, I´m still stuck with it ... > > here´s my tests.py: > > import unittest, os > > class BaseTest(unittest.TestCase): >    def setUp(self): >        pass > >    def tearDown(self): >        pass > >    def test_fileobject(self): >  

Re: Odd ModelForm problem

2009-06-24 Thread Daniel Roseman
On Jun 24, 12:40 am, saxon75 wrote: > I'm having a strange problem with my site wherein a ModelForm doesn't > appear to recognize that it has an attribute that it ought to.  I > should preface this by saying that I recently moved my codebase to a > new server--everything had been working fine on

Re: Processing multiple forms on one page

2009-06-24 Thread Daniel Roseman
On Jun 24, 6:45 am, Oleg Oltar wrote: > Hi! > > I am writing a small application for user profile management. > > I need to display and to process output from 2 form on the page of own > profile. How can I do it? > > 1. Form if to change avatar. (Contains browse and upload buttons) > 2. Form is f

Re: Processing multiple forms on one page

2009-06-24 Thread Oleg Oltar
Thanks! I will try the first idea, will create separate views. But in this case, I will have to add user authentification code to all 3 views Now it looks like this: def user_profile(request, profile_name): currentUser = request.user owner = get_object_or_404(User, username = profi

Re: how to run just ONE test?

2009-06-24 Thread patrickk
just to avoid any misunderstanding: when I´m running one test with "... test myapp.BaseTest.test_fileobject" for example, the output is "... runs 1 test" - but before that statement there´s a lot of "create table ...", "installing index ..." stuff. and that´s what I´m confused about. just wanted

Re: how to run just ONE test?

2009-06-24 Thread Kenneth Gonsalves
On Wednesday 24 June 2009 14:47:05 patrickk wrote: > just to avoid any misunderstanding: > when I´m running one test with "... test > myapp.BaseTest.test_fileobject" for example, the output is "... runs 1 > test" - but before that statement there´s a lot of "create table ...", > "installing index

Re: how to run just ONE test?

2009-06-24 Thread patrickk
but the app I´m testing doesn´t require the database - the file models.py is empty. the create table and installing index statements look like this: Creating test database... Creating table auth_permission Creating table auth_group Creating table auth_user Creating table auth_message ... these s

Re: Uploading Images

2009-06-24 Thread Avinash
The second message posted by shows that the POST request handler didnt find key 'files' in its Multivalue Dictionary.Its I think the keyword 'file' has been deprecated from later versions of Django.So for uploading the file, just make an instance of the form class like, form = ImageForm(request.PO

How to handle image uploading in a proper way

2009-06-24 Thread Oleg Oltar
Hi! I use a following code: def handleUploadedFile(file): destination = open('%s'%(file.name), 'wb+') for chunk in file.chunks(): destination.write(chunk) destination.close() return destination I call it from view using this code. handleUploadedFile(request.FILES['avat

Re: how to run just ONE test?

2009-06-24 Thread Kenneth Gonsalves
On Wednesday 24 June 2009 15:11:57 patrickk wrote: > but the app I´m testing doesn´t require the database - the file > models.py is empty. > > the create table and installing index statements look like this: > Creating test database... > Creating table auth_permission > Creating table auth_group >

Re: Uploading Images

2009-06-24 Thread Avinash
On Jun 24, 2:50 pm, Avinash wrote: > The second message posted by you shows that the POST request handler didnt > find key 'files' in its Multivalue Dictionary.Its I think the keyword > 'file' has been deprecated from later versions of Django.So for > uploading the file, just make an instance o

Re: Uploading Images

2009-06-24 Thread Daniel Roseman
On Jun 15, 4:54 am, Oleg Oltar wrote: > Hi! > > >   {{ form.as_p }} >   > > > After trying this code in browser I am getting a text field with > browse button, so when I chose file to upload, and finally click > upload I am getting 404 Error. > Not sure what I might doing wrong. > Please hel

Skipping an item in a loop

2009-06-24 Thread Daniele Procida
I have a template in which I would like to do the following: {% for item in loop %} {% if [previous item].condition %} item.name {% endif %} {% endfor %} In other words, I want to do something with an item in the loop based on whether the *previous* item has some condition set.

Re: Internationalization in django and search engine indexing

2009-06-24 Thread Miguel Rodriguez
You should have a look at: http://code.google.com/p/django-localeurl/ I'm using it on my site and works really well and it's really easy to set up. You can check an example of how your urls will look once is implemented in here: http:\\jaratech.com Cheers, Miguel On Jun 23, 2:42 pm, Olivier

File upload over

2009-06-24 Thread alecs
Hi :) First of all I should say that I am not experienced in Django ;) I have some problem with file Uploading - if the file is large (700Mb) a strange thing happens with RAM&SWAP :( First it tries to cache something and all the 4Gb or Ram are captured, than the cache is purged and it begins to s

File Upload : Memory consumption

2009-06-24 Thread alecs
Hi! I'm trying to upload a large file (700Mb) and something wrong with django happens: First it starts caching enormously (4Gb of ram are used), than it starts to purge caches and starts swapping (1Gb of swap is used). Have you ever faced with such a thing ? Django 1.02, mod_wsgi + Apache 2.2 Than

Re: Internationalization in django and search engine indexing

2009-06-24 Thread Kenneth Gonsalves
On Wednesday 24 June 2009 13:56:49 Miguel Rodriguez wrote: > You can check an example of how your urls will look once is > implemented in here: http:\\jaratech.com the '\\' did not get converted to '//' ;-) -- regards kg http://lawgon.livejournal.com --~--~-~--~~~---

Re: Skipping an item in a loop

2009-06-24 Thread James Gregory
On Jun 24, 11:15 am, "Daniele Procida" wrote: > I have a template in which I would like to do the following: > > {% for item in loop %} >     {% if [previous item].condition %} >         item.name >     {% endif %} > {% endfor %} > > In other words, I want to do something with an item in the lo

Django doesn't translate the "timesince" filter.

2009-06-24 Thread Jordan
Hi. :) The problem is that the timesince doesn't get translated in my Django application. All other parts of the site are translated without a problem, but this certain filter cannot be translated. But when I request the page via AJAX this messages get translated without a problem (in Bulgarian).

Re: Skipping an item in a loop

2009-06-24 Thread James Gregory
On Jun 24, 11:41 am, James Gregory wrote: > On Jun 24, 11:15 am, "Daniele Procida" > wrote: > > > > > I have a template in which I would like to do the following: > > > {% for item in loop %} > >     {% if [previous item].condition %} > >         item.name > >     {% endif %} > > {% endfor %}

Re: how to run just ONE test?

2009-06-24 Thread Russell Keith-Magee
On Wed, Jun 24, 2009 at 5:17 PM, patrickk wrote: > > just to avoid any misunderstanding: > when I´m running one test with "... test > myapp.BaseTest.test_fileobject" for example, the output is "... runs 1 > test" - but before that statement there´s a lot of "create table ...", > "installing index

Re: how to run just ONE test?

2009-06-24 Thread patrickk
I see. your foreign key example makes things much clearer to me. sorry for not being clear enough about the issue with my first question. thanks a lot, patrick On Jun 24, 12:47 pm, Russell Keith-Magee wrote: > On Wed, Jun 24, 2009 at 5:17 PM, patrickk wrote: > > > just to avoid any misunderst

Using Models for non database obejcts?

2009-06-24 Thread Kusako
Hi- Is it possible to use models for objects that are not supposed to be persisted to the database, or read from it? I would like to use ModelForms, etc for them, but they should not have a table in the db or written to or read from the db. Any help would be appreciated, -markus --~--~-~

Re: Skipping an item in a loop

2009-06-24 Thread Masklinn
On 24 Jun 2009, at 12:47 , James Gregory wrote: > On Jun 24, 11:41 am, James Gregory wrote: >> On Jun 24, 11:15 am, "Daniele Procida" >> wrote: >> >> >> >>> I have a template in which I would like to do the following: >> >>> {% for item in loop %} >>> {% if [previous item].condition %} >>>

Re: Using Models for non database obejcts?

2009-06-24 Thread Russell Keith-Magee
On Wed, Jun 24, 2009 at 7:03 PM, Kusako wrote: > > Hi- > > Is it possible to use models for objects that are not supposed to be > persisted to the database, or read from it? I would like to use > ModelForms, etc for them, but they should not have a table in the db > or written to or read from the

Re: Skipping an item in a loop

2009-06-24 Thread James Gregory
On Jun 24, 12:11 pm, Masklinn wrote: > On 24 Jun 2009, at 12:47 , James Gregory wrote: > > > > > On Jun 24, 11:41 am, James Gregory wrote: > >> On Jun 24, 11:15 am, "Daniele Procida" > >> wrote: > > >>> I have a template in which I would like to do the following: > > >>> {% for item in loop %}

Re: File Upload : Memory consumption

2009-06-24 Thread John M
I've seen quite a few posts on this, and I think it's documented as well. As I recall, there is a certain way of doing large uploads, search the docs and the forum and I'm sure you'll find it. On Jun 24, 3:20 am, alecs wrote: > Hi! I'm trying to upload a large file (700Mb) and something wrong w

Re: File Upload : Memory consumption

2009-06-24 Thread Xavier Ordoquy
On Wed, 2009-06-24 at 03:20 -0700, alecs wrote: > Hi! I'm trying to upload a large file (700Mb) and something wrong with > django happens: First it starts caching enormously (4Gb of ram are > used), than it starts to purge caches and starts swapping (1Gb of swap > is used). > Have you ever faced w

Re: Django admin interface for Web service

2009-06-24 Thread nautilebleu
django-roa seems to be the way to go if your service is RESTful http://bitbucket.org/david/django-roa/ Goulwen On Jun 23, 6:39 pm, Kusako wrote: > Hi- > > I need to access an XMLRPC web service from the Django admin > interface. Basically what I need is some create forms that will send > data

Ifnotequal used with Length filter and a zero value not working

2009-06-24 Thread Matthew
Hey all, I'm having a problem getting ifnotequal logic to work. I have what is basically this layout: {% ifnotequal activeusers|length 0 %} {{ activeusers|length }} Friends Online {% else %} Friends {% endifnotequal %} in one of my templates. Its not quite as simple as that, theres some

Re: django-registration not reflecting changes to forms and views

2009-06-24 Thread David De La Harpe Golden
neri...@gmail.com wrote: > I tried adding more form fields to the > registration form and the changes would never show with touch > dispatch.fcgi, Which fcgi implementation are you using? Assuming apache2 web server, note that the common (since it's in debian and derivatives by default) mod_fcgi

Re: Ifnotequal used with Length filter and a zero value not working

2009-06-24 Thread Marcin Mierzejewski
Hi Matthew, > I have what is basically this layout: > > {% ifnotequal activeusers|length 0 %} >     {{ activeusers|length }} Friends Online > {% else %} >     Friends > {% endifnotequal %} Try this: {% if activeusers %} {{ activeusers|length }} Friends Online {% else %} Friends {% endif

Re: Internationalization in django and search engine indexing

2009-06-24 Thread Olivier
Thanks Miguel, It seems that it does what I want, I will try it ! I'm using django on Google App Engine (with app engine patch) which use differents data models, do you think it will still work ? Cheers, Olivier On 24 juin, 12:30, Kenneth Gonsalves wrote: > On Wednesday 24 June 2009 13:56:49 M

Re: Ifnotequal used with Length filter and a zero value not working

2009-06-24 Thread Matthew
Ah, d'oh - Very obvious, thanks very much! On Jun 24, 1:28 pm, Marcin Mierzejewski wrote: > Hi Matthew, > > > I have what is basically this layout: > > > {% ifnotequal activeusers|length 0 %} > >     {{ activeusers|length }} Friends Online > > {% else %} > >     Friends > > {% endifnotequal %} >

Re: TinyMCE django admin

2009-06-24 Thread Joost Cassee
On Jun 24, 6:10 am, Dhruv Adhia wrote: > Hello All, > > I have following under models.py > > from django.db import models > from django.contrib import admin > from tinymce import models as tinymce_models > > class BlogPost(models.Model): > >     title = models.CharField(max_length=150) >     body

encoding question

2009-06-24 Thread knight
Hi, I have html page with inline editing. (I have text, that when I click on it, it changes to edit box, and I can change the text) I do it with some java scripts. (http://www.yvoschaap.com/index.php/ weblog/ajax_inline_instant_update_text_20/) The problem is that I should save the text that I ch

Re: null values should work here but don't

2009-06-24 Thread K.C. Smith
Thanks so much! A bug: The good news is you're not crazy; the bad news is there's no easy fix. :) But, in fact, I applied one of the patches there and it solved the problem very well. K.C. On Jun 23, 9:28 pm, Karen Tracey wrote: > > Looks like: > > http://code.djangoproject.com/ticket/5622 >

Applying XSLT to an XML file using Django

2009-06-24 Thread Francisco Rivas
Hi everyone in both lists. I created a XSL template and I want to apply it to an XML data (or file) which I get from a django view, I mean, I have this snippet in my views.py http://dpaste.com/59193/ and I have this another snippet to apply an XSL transformation http://dpaste.com/59194/ ( excuse f

Re: why doesn't the "with" template tag transverse blocks?

2009-06-24 Thread buttman
On Jun 24, 12:16 am, Karen Tracey wrote: > On Tue, Jun 23, 2009 at 11:05 PM, Steve Howell wrote: > > > {% extends "base_form.html" %} > > > {% with form.instance as object %} > > > I understand why tags outside the block would not render anything > > within the parent but it is not as clear to m

TinyMCE and Slugfield

2009-06-24 Thread nostradamnit
hi all - I'm having a weird problem. I've had TinyMCE working with a NewStory model in admin. I just added a new field, a Slugfield, and now the TinyMCE is completely different, and doesn't accept my input?!? Normally, the TinyMCE controls were at the bottom of the textarea, and now they're at th

Re: How to load fixtures only once in django unit tests?

2009-06-24 Thread Rama Vadakattu
Very well explained. Thanks Russell Keith-Magee On Jun 23, 4:58 am, Russell Keith-Magee wrote: > On Tue, Jun 23, 2009 at 1:21 PM, Rama Vadakattu > wrote: > > > In unit tests i need to load few fixtures  i have done as below > > >   class TestQuestionBankViews(TestCase): > > >        #load this

Re: Applying XSLT to an XML file using Django

2009-06-24 Thread Daniel Roseman
On Jun 24, 3:53 pm, Francisco Rivas wrote: > Hi everyone in both lists. > > I created a XSL template and I want to apply it to an XML data (or file) > which I get from a django view, I mean, I have this snippet in my > views.pyhttp://dpaste.com/59193/and I have this another snippet to apply an

Re: why doesn't the "with" template tag transverse blocks?

2009-06-24 Thread Karen Tracey
On Wed, Jun 24, 2009 at 11:19 AM, buttman wrote: > Whats wrong with: > > {% with something as x %} > > {% block foo1 %} > {{x}} > {% endblock %} > > {% block foo2 %} > {{x}} > {% endblock%} > > {% block foo3 %} > {{x}} > {% endblock%} > > {% block foo4 %} > {{x}} > {% endblock %} > > {% block foo

Re: makemessages .. not all translations found or commented out

2009-06-24 Thread rskm1
> when I use this command > ./manage.py makemessages -l nl  -e=html,txt,py -- > pythonpath=apps_pinax,templates_pinax > > It finds also text in the txt files.. but it also comments out parts > of translations I found with the first command like > > #~ msgid "Discussion Topics for Tribe" > #~ msgst

Re: why doesn't the "with" template tag transverse blocks?

2009-06-24 Thread Steve Howell
On Jun 23, 9:16 pm, Karen Tracey wrote: > > Raising some sort of error for child template content found outside of a {% > block %} seems like a more reasonable idea.  I have no idea if it's been > asked for/considered/rejected/etc., nor how hard it would be to do.  If you > are really intereste

Re: TinyMCE django admin

2009-06-24 Thread Dhruv Adhia
Allright Joost, Second part is working. I am new to those firebug stuff. Can you guide me to docs? Thanks, On Wed, Jun 24, 2009 at 6:34 AM, Joost Cassee wrote: > > On Jun 24, 6:10 am, Dhruv Adhia wrote: > > Hello All, > > > > I have following under models.py > > > > from django.db import mode

Re: encoding question

2009-06-24 Thread Gustavo Henrique
try: from unicodedata import normalize mytext = '%u05D9%u05D2' newtext = normalize('NFKD', mytext).encode('ASCII','ignore') or: import sys reload(sys) sys.setdefaultencoding('latin-1') --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Can I use django-filebrowser in a form?

2009-06-24 Thread Kusako
Hi- I have a form, not backed by a model and would like to use django- filebrowser for one of its field. Is this possible? I tried someting like my_file = FileBrowseFormField () for my form, but wouldn't work. Thanks for your help, -markus --~--~-~--~~~---~--~~

Re: Using Models for non database obejcts?

2009-06-24 Thread Kusako
Thanks for the rhelp, this clears things up. -markus On Jun 24, 1:21 pm, Russell Keith-Magee wrote: > On Wed, Jun 24, 2009 at 7:03 PM, Kusako > wrote: > > > Hi- > > > Is it possible to use models for objects that are not supposed to be > > persisted to the database, or read from it? I would li

Re: Django admin interface for Web service

2009-06-24 Thread Kusako
Thanks for the link. This looks pretty interesting. Unfortunately the service I have to access isn't RESTful, so it doesn't look like I can make of roa easily. -markus On Jun 24, 1:33 pm, nautilebleu wrote: > django-roa seems to be the way to go if your service is RESTful > > http://bitbucket.o

Django installation and the admin

2009-06-24 Thread Robert
I am going to deploy a django project on a shared host. The server is equipped with apache, mod_python and python. I don't have my own apache instance and I don't have access to python myself. Since Django is effectively a python module and as such will be integrated in python, I wonder what happ

Entering large chunk of data

2009-06-24 Thread Dhruv Adhia
Hello All, I have news field in django admin and I would like to enter 2000 news items at once. May I know how to do it in shorter way? Thanks, Dhruv --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: Applying XSLT to an XML file using Django

2009-06-24 Thread Francisco Rivas
Sorry I forgot that important information : What do you mean, 'nothing' when you tried to use it inside the view? The final XML file, that obtained of apply the XSL template to the original XML, is not created. What happened when you imported it? What happened when you called it? When I impo

Problem with passing information from related model to a view

2009-06-24 Thread paultanner
As you can see from this I am just learning django. I am trying to list contacts and their related organisations. This does list the contact names. No errors are raised but fields from Organisations do not show with this view and template. I guess I need to be more explicit in referncing the rela

Re: django-registration not reflecting changes to forms and views

2009-06-24 Thread neridaj
I am on Dreamhost using Mod_fastcgi and believe that this is my only option at the moment. I tried pkill python and pkill .*dispatch.fcgi with no change. The only changes that are reflected are changes to the template and the urls i.e., the view and form that are called by the url have been delete

Re: Problem with passing information from related model to a view

2009-06-24 Thread Daniel Roseman
On Jun 24, 6:26 pm, paultanner wrote: > As you can see from this I am just learning django. > I am trying to list contacts and their related organisations.  This > does list the contact names. > No errors are raised but fields from Organisations do not show with > this view and template. > I gues

Re: Entering large chunk of data

2009-06-24 Thread creecode
Hello Dhruv, Two ways you can do this, that I know. Use your databases' built in data import technique. For example with MySql you can use LOAD DATA. Alternately you could use manage.py shell to run python code to load your data. Read about manage.py shell and dbshell here < http://docs.django

Re: Flatpages only works when settings.DEBUG = True

2009-06-24 Thread Fred Chevitarese
What you´ve done? I´m getting this problem and, try all the following steps like you, but still not working ! Can you help me ?? On 5 maio, 04:07, Ronghui Yu wrote: > It works now. That's because a typo error happens in my 404.html page. And > it introduces 500.Thanks all. > > > > On Tue, May 5

Re: File Upload : Memory consumption

2009-06-24 Thread alecs
The maximum size, in bytes, for files that will be uploaded into memory. Files larger than FILE_UPLOAD_MAX_MEMORY_SIZE will be streamed to disk. Defaults to 2.5 megabytes. My file size is greater than 2.5Mb, so it will be streamed to disk... --~--~-~--~~~---~--~~ Y

Re: Entering large chunk of data

2009-06-24 Thread Dhruv Adhia
Hey, I would prefer second method as I am using sqlite3. Is this what you mean? django-admin.py loaddata mydata.json , If so I how do I populate json file such large amounts of data? Thanks, On Wed, Jun 24, 2009 at 10:48 AM, creecode wrote: > > Hello Dhruv, > > Two ways you can do this, that

Django with mod_wsgi troubles

2009-06-24 Thread Laran Evans
I've tried a bunch of different approaches going back and forth between mod_python and mod_wsgi. I can't get past this one error: NoSectionError at / No section: 'formatters' Request Method: GET Request URL:http://localhost:1/ Exception Type: NoSectionError Exception Val

Using two different Comment Instances

2009-06-24 Thread grElement
I'm familiar with modifying comments to change functionality, that's well documented. But what I want to do is use a modified version of comments on a model and also the standard comments. So I have a model "post" and I want to enable comments, easy enough, and then I want to enable mod_comments

Re: File Upload : Memory consumption

2009-06-24 Thread alecs
If to be honest I can't google this posts ... Most of the links are for patches or for old django versions :( Don't know, maybe I should try to set FILE_UPLOAD_MAX_MEMORY_SIZE, but I didn't change it , so the default value is 2.5Mb ... On Jun 24, 2:54 pm, John M wrote: > I've seen quite a few po

Re: Odd ModelForm problem

2009-06-24 Thread saxon75
I see. Well, I guess I don't know why it worked before either. I made the following change and that seems to have cleared up the problem: This: if not form.slug: form.slug = slugify(form.title) if form.is_valid(): article = form.save(commit=False) is now: if form.is_valid(): article =

Re: Skipping an item in a loop

2009-06-24 Thread Daniele Procida
On Wed, Jun 24, 2009, James Gregory wrote: >> >>> I have a template in which I would like to do the following: >> >> >>> {% for item in loop %} >> >>>     {% if [previous item].condition %} >> >>>         item.name >> >>>     {% endif %} >> >>> {% endfor %} >> >> >>> In other words, I want to do

django-cloudfiles

2009-06-24 Thread Ross Dakin
Hi everyone, I have a young project on github that lets you dump your site's static media to a CloudFiles account (a cloud storage service offered by Mosso / the Rackspace Cloud, which integrates with Limelite's CDN). http://github.com/rossdakin/django-cloudfiles/ And if you like the idea, how

Re: Entering large chunk of data

2009-06-24 Thread creecode
Hello Dhruv, On Jun 24, 11:03 am, Dhruv Adhia wrote: > Is this what you mean? > django-admin.py loaddata mydata.json , If so I how do I populate json file > such large amounts of data? The LOAD DATA was in reference too the LOAD DATA INFILE command < http://dev.mysql.com/doc/refman/5.1/en/load

Re: Entering large chunk of data

2009-06-24 Thread Carl Zmola
in sqlite3 (the sqlite3 shell), you can use .import to import data from a text file. It works great. You may need to change the separator. For a one time load, this is probably the easiest method. Dhruv Adhia wrote: > Hey, > > I would prefer second method as I am using sqlite3. > > Is this

Webapp creation: Check box like search to find common ground

2009-06-24 Thread Divesh Gidwani
Hey Guys, This is my first post on this group. I'm a newbie to Django, Python and mysql, and have recently been asked by my boss to make a web page of a Database. What I have to do: Take the tables from the database(which is in mysql) and create a web application to show which groups belong to

PostgreSQL Conference West 2009 Call for Papers

2009-06-24 Thread Joshua D. Drake
PostgreSQL Conference West 2009 Call for Papers June 24th, 2009, the PostgreSQL Conference U.S. team is pleased to announce the West 2009 venue and call for papers. This year the premiere West Coast PostgreSQL Conference will be leaving its roots at Portland State University and moving north to s

Re: Entering large chunk of data

2009-06-24 Thread Dhruv Adhia
Thanks guys, I think Ill go with .import filename tablename I have the table sqlite> .schema promo_new CREATE TABLE "promo_new" ( "id" integer NOT NULL PRIMARY KEY, "title" varchar(200) NOT NULL, "news_content" varchar(200) NOT NULL, "pub_date" datetime NOT NULL ); for news model s

TimeField and null

2009-06-24 Thread adrian
I need a time field that can be None. I define the field so that Null is legal in the DB: time_end = models.TimeField(blank=True, null=True) The form field is: time_end = forms.ChoiceField(required=False, choices=END_TIME_CHOICES) and END_TIME_CHOICES is: END_TIME_CHOICES = ( (None, 'En

Re: TimeField and null

2009-06-24 Thread Gabriel .
Hi, On Wed, Jun 24, 2009 at 4:57 PM, adrian wrote: > > > I need a time field that can be None. > > I define the field so that Null is legal in the DB: > > time_end = models.TimeField(blank=True, null=True) > My question is why does this field give a validation error when None > is selected, say

FileField can't re-display invalid form with File upload widget filled-in?

2009-06-24 Thread Chris Shenton
I've got an app that wants a file upload and some other attributes. If the user fills in the file but has problems with the other attributes, it should re-present the form with the attributes filled with his values, including the name of the file that he selects. In use the example below

Re: FileField can't re-display invalid form with File upload widget filled-in?

2009-06-24 Thread Reiner
I doubt that this is possible, looks like a security risk if you can select files from the clients pc arbitrary to be uploaded. If that would be possible, a malicious website could embed a in its code, preselect a file from the clients pc, and hide that element with CSS. Most users probably would

modifying or deleting forms and views has no effect on app

2009-06-24 Thread neri...@gmail.com
I've been trying to figure out why modifications made to forms and views have no effect on the app they belong to. I'm using django- registration and wanted to add some additional fields to the registration form but any changes I make, including deleting forms.py or views.py, has no effect on the

Practical Django Projects or Pro Django Books

2009-06-24 Thread ydjango
For some at intermediate level in Django and basic level in Python ( learned Python thru django) which would be better book for next reading Practical Django Projects by James Bennet or Pro Django by Marty Alchin. --~--~-~--~~~---~--~~ You received this messag

email for user name in Authentication

2009-06-24 Thread bigme
I want to use email for user name. How can I increase size of username in django auth from 30 to 50. Also I want two or more accounts to have same user name/ email but different passwords. So username password combination is unique but username is not unique. Can I do this through django auth or

Re: TimeField and null

2009-06-24 Thread adrian
If you look, blank is set to True, and it still returns the validation error. On Jun 24, 3:25 pm, "Gabriel ." wrote: > Hi, > > On Wed, Jun 24, 2009 at 4:57 PM, adrian wrote: > > > I need a time field that can be None. > > > I define the field so that Null is legal in the DB: > > > time_end = mo

Getting related objects

2009-06-24 Thread Daniele Procida
I have an application, with a model called Entities. I have another, with a model called NewsItem: class NewsItem(models.Model): destined_for = models.ManyToManyField( Entity, ) I can get a list of NewsItems for a particular Entity with something like: Entity.objects.al

Re: email for user name in Authentication

2009-06-24 Thread Michael
On Wed, Jun 24, 2009 at 5:24 PM, bigme wrote: > > I want to use email for user name. How can I increase size of username > in django auth from 30 to 50. > > Also I want two or more accounts to have same user name/ email but > different passwords. So username password combination is unique but > u

Re: django admin delete oneToOneField ?

2009-06-24 Thread Mr. T
I saw this in the docs: "When Django deletes an object, it emulates the behavior of the SQL constraint ON DELETE CASCADE -- in other words, any objects which had foreign keys pointing at the object to be deleted will be deleted along with it." So it sounds like you don't need to do anything. On

Re: Django with mod_wsgi troubles

2009-06-24 Thread Graham Dumpleton
On Jun 25, 4:05 am, Laran Evans wrote: > I've tried a bunch of different approaches going back and forth > between mod_python andmod_wsgi. I can't get past this one error: > > NoSectionError at / > > No section: 'formatters' > > Request Method:         GET > Request URL:    http://localhost:100

Re: django-registration not reflecting changes to forms and views

2009-06-24 Thread Graham Dumpleton
On Jun 24, 10:10 pm, David De La Harpe Golden wrote: > neri...@gmail.com wrote: > > I tried adding more form fields to the > > registration form and the changes would never show with touch > > dispatch.fcgi, > > Which fcgi implementation are you using? Assuming apache2 web server, > note that t

Re: application scope objects? (maybe need cherrypy instead)

2009-06-24 Thread qwcode
sorry to intrude, but the question has come up twice (with 2 different authors) on the list in the last few months with no replies. I'll try again on the user list with some different words --~--~-~--~~~---~--~~ You received this message because you are subscribed t

objects in memory that don't time out?

2009-06-24 Thread qwcode
This is a re-phrase of a previous email... trying to trigger an answer using terms that might make more sense to this list. I'm more familiar with java frameworks. Is there a way to have objects persist in memory that don't time out? For example, in cherrypy, there's an Application object that

Re: objects in memory that don't time out?

2009-06-24 Thread Graham Dumpleton
On Jun 25, 9:35 am, qwcode wrote: > This is a re-phrase of a previous email... trying to trigger an answer > using terms that might make more sense to this list.  I'm more > familiar with java frameworks. > > Is there a way to have objects persist in memory that don't time out? > > For example,

Re: objects in memory that don't time out?

2009-06-24 Thread qwcode
let me give an example suppose I want to store an XSLT template object to be reused over and over to transform xml where can I put it? I don't want to put in the backend cache, right? that times out? --~--~-~--~~~---~--~~ You received this message because you ar

Re: objects in memory that don't time out?

2009-06-24 Thread Graham Dumpleton
On Jun 25, 9:58 am, Graham Dumpleton wrote: > On Jun 25, 9:35 am, qwcode wrote: > > > This is a re-phrase of a previous email... trying to trigger an answer > > using terms that might make more sense to this list.  I'm more > > familiar with java frameworks. > > > Is there a way to have object

Re: Practical Django Projects or Pro Django Books

2009-06-24 Thread Nick Lo
> For some at intermediate level in Django and basic level in Python > ( learned Python thru django) which would be better book for next > reading Practical Django Projects by James Bennet or Pro Django by > Marty Alchin. I don't think you can say either is better as their approach is quite dif

Re: TimeField and null

2009-06-24 Thread Karen Tracey
On Wed, Jun 24, 2009 at 3:57 PM, adrian wrote: > > > I need a time field that can be None. > > I define the field so that Null is legal in the DB: > > time_end = models.TimeField(blank=True, null=True) > > The form field is: > > time_end = forms.ChoiceField(required=False, choices=END_TIME_CHOICE

Re: debugging

2009-06-24 Thread db_333
This does not appear to be the issue, although the indentations are wrong in the posting. The following is what they really are. What am I missing? I am still not sure why unit.save() is not working. def save_unit(request): if request.method == 'POST': form = UnitFormSave(request.POS

Using Signals as hooks

2009-06-24 Thread Wiiboy
I'm a bit of a noob at Web Devlopment (as you already know if you've read any of my posts on here). I've read that using hooks in key places in a website can help ease future development. Can/Should Django's signals be used for that purpose? If so, to what extent should they be used? For examp

How can I use database view in Django

2009-06-24 Thread vince
I saw the former question in stackoverflow "can i use a database view as a model in django"[http://stackoverflow.com/questions/507795/can-i- use-a-database-view-as-a-model-in-django] and try it in my app,but that's not work.I create a view named "vi_topics" manually and it had "id" column。But I a

Re: objects in memory that don't time out?

2009-06-24 Thread qwcode
> So, as far as question you pose in different thread, look at Python > module global variables. If you don't understand how that helps, then > you don't understand how Python global variables work. Just be aware > of the issues that global variables cause in context of multiprocess > web server

Re: objects in memory that don't time out?

2009-06-24 Thread Graham Dumpleton
On Jun 25, 3:28 pm, qwcode wrote: > > So, as far as question you pose in different thread, look at Python > > module global variables. If you don't understand how that helps, then > > you don't understand how Python global variables work. Just be aware > > of the issues that global variables ca

Re: Problem with passing information from related model to a view

2009-06-24 Thread paul_tanner
Thx. DR. Duh. I had the foreignkey in an earlier test and then took it out again. Interesting that no error raised. The other thing is that the template needed to call for the related field thus: {{ obj.fname }} {{ obj.sname }} : {{ obj.organisation.organisation }} (seems logical now) With t