Re: @cache_control() and @never_cache not working

2009-01-30 Thread BluMarble
Thanks for the help Thomas, unfortunetly it wouldn't be within budget to port this site over to 1.0. Will however look into the link you provided. On Jan 29, 12:50 pm, Tomas Kopecek wrote: > In that version (0.96) of Django was bug in combination of these > decorators and CacheMiddleware. If you

FileField and moving or updating files

2009-01-30 Thread timc3
Hi, I have a fairly standard model: class MediaObject(models.Model): """ An instance of a MediaItem """ name = models.CharField(max_length=256) path = models.FileField(_("File"), max_length=256, upload_to='tempUpload/') And thats all well and good, my uploads work and so on. But wha

Re: Complex queries with datetime field

2009-01-30 Thread Stefan Tunsch
Hi Malcolm! Well, as you say, the range lookup simplifies the code. I am using MySQL and adding a timedelta of 1 day to a date object and comparing the range with my datetime field works indeed as expected. Thanks for your help. It's been very instructive. ;) Regads, Stefan Malcolm Tredi

Re: #7210 - F() Query Expressions

2009-01-30 Thread koenb
> > As committed, the expressions framework is fairly dumb - it is really > just a way to do two things: >  1) Expand Django-style field references into column names (and joins > if required) >  2) Turn Python expression trees into SQL expression trees. > > This means that the operations that are

Caught an exception while rendering: 'Feature' object has no attribute 'serializable_value'

2009-01-30 Thread Thiago F. Crepaldi
Hello, my site is almost ready, but i still getting some issues along the way. To day i am testing the admin module and i found out some issues. All models that use some foreign key presents a message like this: TemplateSyntaxError at /ftrTool/admin/ftrTool/dependency/3/ Caught an exception whi

Re: Model for newbie

2009-01-30 Thread bruno desthuilliers
On 30 jan, 08:16, Kirill wrote: > Hello all! > > I have some logic problem I really don't understand how make model > for this task: > > I have registered users (i want to use User class). > Each registered user can create project (or group or blog) where he > can invite another users > So,

Re: Any way to NOT escape a percent sign using 'contains'?

2009-01-30 Thread Adam Stein
Thanks for the advice. I was kinda thinking I would have to use regex. I hadn't thought of puting the replace() in a custom cleaning method, but I agree that sounds like a good place to put it. On Fri, 2009-01-30 at 13:59 +1100, Malcolm Tredinnick wrote: > On Thu, 2009-01-29 at 18:47 +, Adam

Re: #7210 - F() Query Expressions

2009-01-30 Thread Russell Keith-Magee
On Fri, Jan 30, 2009 at 7:59 PM, koenb wrote: > >> As committed, the expressions framework is fairly dumb - it is really >> just a way to do two things: >> 1) Expand Django-style field references into column names (and joins >> if required) >> 2) Turn Python expression trees into SQL expression

admin: list users of a group

2009-01-30 Thread Thomas Guettler
Hi, sometimes it would be nice to see all users of a group. I think it would be nice to have this in the admin page. Do other django users miss this, too? I know that it is very easy to write a view for this, but it would be even better if it is a part of the django admin. Thomas PS: Of cou

"setup_environ" can't help to run a standalone script

2009-01-30 Thread Orcun Avsar
im trying to run a seperate script that is on my project directory. setup_environ seems called correctly but progmram cant import models properly code: from django.core.management import setup_environ import settings setup_environ(settings) from indir.program.models import Program, Hit output:

How to clear form from wrong data

2009-01-30 Thread Konstantin S
Hello! I believe this is a VERY basic question, that already covered somewhere in the excellent django docs, but I couldn't find an answer and therefor asking for some help. In my view I have this request handler: http://dpaste.com/114650/. The problem is that after wrong data input (i.e. no data

Re: guidance on serialization

2009-01-30 Thread Russell Keith-Magee
On Fri, Jan 30, 2009 at 7:30 AM, Jason Geiger wrote: > > Hello all. Say I have some models like these: > > class Image(models.Model): >file = models.ImageField(upload_to=get_image_path) > > class Line(models.Model): >image = models.ForeignKey(Image) >color = models.CharField(max_lengt

Django Error mails

2009-01-30 Thread madhav
As we all know when any 500 error shows up, django sends an exception email to all the admins of the site. I was thinking DJango will be using the smtp library to create mail objects and will be using any local MTA(sendmail in my case) to send emails to all the admins. I have got two questions reg

Re: How to pass the variable which is defined in the views.py to the jQuery function

2009-01-30 Thread min
Thanks a lot. Besides, what's the meaning for the 'escape_js' in [var x = "{{ variable|escape_js }}"] ? Regards Min On Jan 30, 4:33 pm, Malcolm Tredinnick wrote: > On Thu, 2009-01-29 at 21:11 -0800, min wrote: > > Hi. > > > First, the code in the forms.py: > > > class TestForm(forms.Form): > >

Re: How to clear form from wrong data

2009-01-30 Thread Daniel Roseman
On Jan 30, 1:11 pm, Konstantin S wrote: > Hello! > > I believe this is a VERY basic question, that already covered > somewhere in the excellent django docs, but I couldn't find an answer > and therefor asking for some help. > In my view I have this request handler:http://dpaste.com/114650/. The >

Re: How to clear form from wrong data

2009-01-30 Thread Konstantin
On Jan 30, 5:18 pm, Daniel Roseman wrote: > Not certain I fully understand your flow here, but surely if in line > 10 you just did: >             form = MediaGetForm() > that would solve your problem? You're passing in the POST dictionary > each time - if you want a blank form, simply don't pass

Re: How to clear form from wrong data

2009-01-30 Thread Konstantin
On Jan 30, 5:18 pm, Daniel Roseman wrote:> > Not certain I fully understand your flow here, but surely if in line > 10 you just did: >             form = MediaGetForm() > that would solve your problem? You're passing in the POST dictionary > each time - if you want a blank form, simply don't pass

Re: How to clear form from wrong data

2009-01-30 Thread Karen Tracey
On Fri, Jan 30, 2009 at 9:45 AM, Konstantin wrote: > > On Jan 30, 5:18 pm, Daniel Roseman > wrote:> > > Not certain I fully understand your flow here, but surely if in line > > 10 you just did: > > form = MediaGetForm() > > that would solve your problem? You're passing in the POST di

Re: How to pass the variable which is defined in the views.py to the jQuery function

2009-01-30 Thread Almost George
On Jan 30, 6:09 am, min wrote: > Thanks a lot. > > Besides, what's the meaning for the 'escape_js' in [var x = > "{{ variable|escape_js }}"] ? > > Regards > Min > > On Jan 30, 4:33 pm, Malcolm Tredinnick > wrote: > > > On Thu, 2009-01-29 at 21:11 -0800, min wrote: > > > Hi. > > > > First, the

Re: #7210 - F() Query Expressions

2009-01-30 Thread koenb
On 30 jan, 13:46, Russell Keith-Magee wrote: > If you are interested in implementing this, I'm happy to give you > pointers. The first pointer I can suggest is that you will be looking > at the SQLEvaluator class contained in > django/db/models/sql/expressions.py. This class traverses the > expr

Re: building a blog site

2009-01-30 Thread Muslu Yüksektepe
i deleted my blog site. i am preparing new blog. its not only blog site. it have wiki, blog, category, sub category, photo album and full cms. i will show u as soon as. i have to configure a server. i am using mod_python, apache, filebrowser, tinymce please wait me thank you from Turkey 2009/1/30

Re: How to clear form from wrong data

2009-01-30 Thread Konstantin
On Jan 30, 6:21 pm, Karen Tracey wrote: > > Maybe you give me one more tip: how to display error message of > > previous wrong input and show new empty form at the same time ? > > Are you sure you want to do that?  As a user I'd find it very annoying for a > web form to be re-displayed with error

Re: DateField comparison with date.today()

2009-01-30 Thread Tim Sawyer
On Wednesday 28 January 2009 04:34:50 Malcolm Tredinnick wrote: > On Tue, 2009-01-27 at 22:03 +, Tim Sawyer wrote: > > Hi, > > > > I have a model that includes: > > > > from datetime import date as pydate, datetime > > > > date = models.DateField() > > > > I've overridden delete to do: > > > >

Re: Can I control contents of SELECT in queryset?

2009-01-30 Thread phoebebright
Using your suggestion returns no values: In [9]: Subcategory.objects.values('name').exclude(business=None) Out[9]: [] And there are subcategories: In [10]: Subcategory.objects.values('name') Out[10]: [{'name': u'Agricultural'}, {'name': u'Auctioneers & Estate Agents'}, {'name': u'Construction &

Re: Has anyone looked into writing an SSH backend for file uploads?

2009-01-30 Thread Jeff FW
Instead of trying to get Django to do something like that, have you looked into using sshfs? That would make it essentially transparent-- all Django would know is that it's saving a file to a filesystem. http://en.wikipedia.org/wiki/SSHFS On Jan 29, 9:05 am, Andrew Ingram wrote: > On Jan 29, 1

Re: How to clear form from wrong data

2009-01-30 Thread Karen Tracey
On Fri, Jan 30, 2009 at 10:38 AM, Konstantin wrote: > > On Jan 30, 6:21 pm, Karen Tracey wrote: > > > Maybe you give me one more tip: how to display error message of > > > previous wrong input and show new empty form at the same time ? > > > > Are you sure you want to do that? As a user I'd fin

django fastcgi broken links

2009-01-30 Thread Vitaly
Hi all I moved my django site to lighttpd with fastcgi. Everything works good (site opens) but sometime my links on website directs users to http://localhost/fg.fcgi/login as an example. This is not for all links, some links work good. I appreciate any help to solve my problem --~--~-~-

Change uploaded filename

2009-01-30 Thread Alex Jonsson
I know this question has been asked before, but I've never seen a proper answer. My situation is as follows: In our news application the editors are able to upload photos, and I'd like to change the name of these to a random 10 char md5 hash based on the current timestamp. The reason for this is

Re: odd cache behavior with memcached

2009-01-30 Thread levity
i found a workaround on an old mailing list post that came up through a google search: it was to downgrade cmemcache, which is the python module for communicating with memcached, from 0.95 to 0.91. i wish i knew why that worked... On Jan 30, 2:56 am, levity wrote: > code sample:http://dpaste.co

summary of two models+detailed view--how to structure?

2009-01-30 Thread Tim Arnold
Hi, I have two basic models for a book-production site: book configuration build reports I want to display information for a particular book so you can drill- down from a summary of its configuration and build to a detailed view of its configuration and build report. The way I have it set up now

Re: Django Forms in HTML 4.01 Strict

2009-01-30 Thread Rob Hudson
Here's some food for thought on the subject of HTML 4.01 in Django (as it's been discussed a lot before): James Bennet brought up the HTML4 argument on the Django developers list some time ago: http://groups.google.com/group/django-developers/browse_thread/thread/a233bb5b3b39e147/7c9bf930a533345b

media-serving hell!

2009-01-30 Thread DrKayBee
I'm having a ridiculously tough time trying to figure out how to serve static media. Here's the state of the website: Templates being found properly (although without css / static media) Admin template being found properly (again without css / etc) Here's my directory structure for the project:

Inheret/Override custom Form class methods in a custom ModelForm

2009-01-30 Thread Stewart
Hi. I have a a subclass of Form with some of my own methods in it, what would be the best way of getting those methods into a ModelForm subclass. For example: class MyForm(forms.Form): --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: Has anyone looked into writing an SSH backend for file uploads?

2009-01-30 Thread Alex Robbins
It might be even easier to just set up an NFS mount of the other machines. It would be a lot like Jeff's idea, but NFS is pretty tried and true. (I don't know anything about SSHFS, it might be really good too.) On Jan 30, 9:54 am, Jeff FW wrote: > Instead of trying to get Django to do something

Re: Inheret/Override custom Form class methods in a custom ModelForm

2009-01-30 Thread Stewart
Opps :) Continued... class MyForm(forms.Form): def as_span(self): # format form in a html span How can I get the as_span method into ModelForm without rewriting it? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: django fastcgi broken links

2009-01-30 Thread Karen Tracey
On Fri, Jan 30, 2009 at 11:07 AM, Vitaly wrote: > > Hi all > > I moved my django site to lighttpd with fastcgi. Everything works good > (site opens) but sometime my links on website directs users to > http://localhost/fg.fcgi/login as an example. This is not for all > links, some links work good.

Re: media-serving hell!

2009-01-30 Thread DrKayBee
Quick update: I can see the directory listing under http://mydomain.com/media/ On Jan 30, 10:22 am, DrKayBee wrote: > I'm having a ridiculously tough time trying to figure out how to serve > static media. Here's the state of the website: > Templates being found properly (although without css /

Re: How to pass the variable which is defined in the views.py to the jQuery function

2009-01-30 Thread Alex Robbins
You might also consider using simplejson to dump the python variable into something that JavaScript could understand. (This way you can pass more complicated variables like an array or an object.) I recently did that to get a list of tags out to some javascript on the front end. On Jan 29, 11:33 

Re: How to pass the variable which is defined in the views.py to the jQuery function

2009-01-30 Thread Alex Robbins
Sorry, a code sample would have been more helpful. With a python variable "tags" that has a list of tags to pass to js, it would look roughly like this: tags = ['fun', 'exciting', 'cool'] from django.utils import simplejson variable_to_insert_into_template = "%s" % simplejson.dumps(tags) Pass v

Show edit link instead of forms on inlines

2009-01-30 Thread Duda Nogueira
Hi there! I searched over the internet, but can find a solution for what i need. When i insert an inline model into another model on the django admin, it does a pretty good job, showing all the foreign objects on the parent model, with editable form for each object. But that's way too much from

Inherit/Override custom Form class methods in a custom ModelForm class

2009-01-30 Thread Stewart
Hi. I have a subclass of Form with some of my own methods in it, what would be the best way of getting those methods into a ModelForm subclass. For example: class MyForm(forms.Form): def as_span(self): “format form in a html span” return self._html_output(u' %(field)s’, False) class

inspectdb throws "_mysql_exceptions.Warning: Can't read dir of './test/' (errno: 13)"

2009-01-30 Thread dick...@gmail.com
pretty basic database i created using the "polls" tutorial, and now trying to test inspectdb (which i need to run against a legacy db). (fwiw, i tried creating a test dir, and didn't help) thanks, bash-3.2$ python manage.py inspectdb # This is an auto-generated Django model module. # You'll have

Missing REFERENCES... in SQL of models.ForeignKey('LaterDefinedModel')

2009-01-30 Thread mucisland
Hi all. If I specify the ForeignKey target model as a string because it is not yet defined, the (SQLite3) SQL table entry misses the REFERENCES specifier. Example: class Department(models.Model): head = models.ForeignKey('Person', related_name='heads') class Person(models.Model): departm

GET Requests and URLS

2009-01-30 Thread Alfonso
Hi, I've got a simple form that acts as a filter to enable users to reach listings in various countries and I've set up a view that either redirects the user to the correct url or in the case of a query present; diverts to a search url that processes via GET. So the problem I'm having is sending

Re: passing self?

2009-01-30 Thread Matthias Julius
ajlozier writes: > As for your suggestion to start a beginners django group - it is not > that I am opposed to that, but as I am only a beginner myself I am not > sure it would be very appropriate or effective. As I myself could not > volunteer on that project in terms of answering beginner's q

Re: ContentTypes and fixtures

2009-01-30 Thread Oliver Beattie
> Oliver, meet ticket #7052. Ticket #7052, meet Oliver :-)\ Thanking you, I'm not as familiar with the tickets as I should be =) > The best workaround that I can suggest is to include your ContentTypes > in your fixtures. They are dumpable objects, just like everything else > in Django. If your f

Re: inspectdb throws "_mysql_exceptions.Warning: Can't read dir of './test/' (errno: 13)"

2009-01-30 Thread dick...@gmail.com
for some more info, i debugged it down to this line: File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/db/backends/mysql/introspection.py", line 70, in get_relations AND referenced_column_name IS NOT NULL""", [table_name]) it seems the table_name i

Re: django fastcgi broken links

2009-01-30 Thread Vitaly
Everything is ok now. I should read more manual and look at FORCE_SCRIPT_NAME. Anyway thanks On Jan 30, 6:37 pm, Karen Tracey wrote: > On Fri, Jan 30, 2009 at 11:07 AM, Vitaly wrote: > > > Hi all > > > I moved my django site to lighttpd with fastcgi. Everything works good > > (site opens) but

Re: summary of two models+detailed view--how to structure?

2009-01-30 Thread Daniel Roseman
On Jan 30, 4:15 pm, Tim Arnold wrote: > Hi, I have two basic models for a book-production site: > book configuration > build reports > > I want to display information for a particular book so you can drill- > down from a summary of its configuration and build to a detailed view > of its configura

How do I correctly format a Querydict derived list in a url?

2009-01-30 Thread Alfonso
I've got a form delivering multiple variables from a checkbox group via POST to a view that defines where to redirect to. I've got django to pass the values of this Querydict to a redirect response but can't change the formatting: In my view: location_filter = request.POST.getlist("location") r

Re: How do I correctly format a Querydict derived list in a url?

2009-01-30 Thread Alex Koshelev
Try this: return HttpResponseRedirect('/activities/%s/' % "-".join(location_filter)) On Fri, Jan 30, 2009 at 10:26 PM, Alfonso wrote: > > I've got a form delivering multiple variables from a checkbox group > via POST to a view that defines where to redirect to. > > I've got django to pass the

Re: How do I correctly format a Querydict derived list in a url?

2009-01-30 Thread Alfonso
Thanks Alex, I tried that but no joy - the problem is I just can't get django to nicely capture the list's values - it's really stumped me! location_filter = request.POST.getlist("location") does give me a python list of location variables. But I can't get this resultant [u'ireland', u'nireland

Re: Inherit/Override custom Form class methods in a custom ModelForm class

2009-01-30 Thread Daniel Roseman
On Jan 30, 4:57 pm, Stewart wrote: > Hi. > > I have a subclass of Form with some of my own methods in it, what > would be the best way of getting those methods into a ModelForm > subclass. > > For example: > > class MyForm(forms.Form): >   def as_span(self): >     “format form in a html span” >  

unsubscribe

2009-01-30 Thread reed crowe
--~--~-~--~~~---~--~~ 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, send email to django-users+unsubscr...@googleg

Re: summary of two models+detailed view--how to structure?

2009-01-30 Thread Tim Arnold
On Jan 30, 2:21 pm, Daniel Roseman wrote: > On Jan 30, 4:15 pm, Tim Arnold wrote: > > > > > > > Hi, I have two basic models for abook-productionsite: > >bookconfiguration > > build reports > > > I want to display information for a particularbookso you can drill- > > down from a summary of its co

Using hashing for password checking in auth module

2009-01-30 Thread Guy Rutenberg
Hi, I've started using Django recently and when I've used the auth module I noticed that it only verifies a plain text password. I'm not comfortable with this behaviour as it means that passwords have to be sent by login forms in plain text. In previous projects of mine I've used a solution that

new record - onetoonefield - create related record

2009-01-30 Thread John M
Given the model's below, I'm trying to make it add the related 1-1 record automatically, but it's not working, what am i missing? Thanks John class unixhost(models.Model): name = models.CharField(max_length=50) # short name fqdn = models.CharField(max

Re: How to pass the variable which is defined in the views.py to the jQuery function

2009-01-30 Thread min
Thank you very much! So you mean if I want pass the 'tags' list to the javascrip, the your code example should be added in the views.py. After that, I can use the list by using var x = {{variable_to_insert_into_template}} in my javascript? Regards Min On Jan 31, 3:48 am, Alex Robbins wrote:

Re: Using hashing for password checking in auth module

2009-01-30 Thread Martin Conte Mac Donell
On Fri, Jan 30, 2009 at 5:36 PM, Guy Rutenberg wrote: > I've started using Django recently and when I've used the auth module > I noticed that it only verifies a plain text password. I'm not > comfortable with this behaviour as it means that passwords have to be > sent by login forms in plain tex

Re: How to pass the variable which is defined in the views.py to the jQuery function

2009-01-30 Thread Alex Robbins
Yeah, that code would go in the views.py. simplejson is just an easy way to turn python variables into a string that javascript would be able to evaluate. Actually, if you are going to use the var x = make sure you take the "" tags out of my example. I think your template should look like this: <

Re: ContentTypes and fixtures

2009-01-30 Thread Eric Holscher
On Jan 30, 12:06 pm, Oliver Beattie wrote: > > Oliver, meet ticket #7052. Ticket #7052, meet Oliver :-)\ > > Thanking you, I'm not as familiar with the tickets as I should be =) > > > The best workaround that I can suggest is to include your ContentTypes > > in your fixtures. They are dumpable

ModelForm and submitting a null value via JSONI

2009-01-30 Thread steve
Hi everyone, this issue is related simply to using jquery's $.post to send some data to my view. I want to edit an item via Ajax (i..e the way de.li.cious lets you edt an item without refreshing page) : JAVASCRIPT - data = { "name":"apple", "id":ingred_id,

Re: ModelForm and submitting a null value via JSONI

2009-01-30 Thread steve
Dang, I need to make a correction. Meant to type: Ingr = IngredientEditForm(request.POST, instance=Item), not: instance=I On Jan 30, 2:01 pm, steve wrote: > Hi everyone,  this issue is related simply to using jquery's $.post to > send some data to my view. I want to edit an item vi

Session Variables as Default Form Values

2009-01-30 Thread Ty
I've went through the documentation for "modelforms" and "forms" but I couldn't figure our how someone would set the default value for a form field to a session variable. I have a checkbox in my comment form that says "remember my information". After a comment is submitted and if the checkbox is

Re: Session Variables as Default Form Values

2009-01-30 Thread Tyler Brownell
http://groups.google.com/group/django-users/browse_thread/thread/ed74391560c762bb On Fri, Jan 30, 2009 at 5:03 PM, Ty wrote: > I've went through the documentation for "modelforms" and "forms" but I > couldn't figure our how someone would set the default value for a form > field to a session vari

Re: ModelForm and submitting a null value via JSONI

2009-01-30 Thread steve
This is frustrating. I need to slow down before posting. I wanted to make it clear that I still have the problem, it's just that I was correcting the way I typed out the example in this forum. On Jan 30, 2:03 pm, steve wrote: > Dang, I need to make a correction. Meant to type: > >   Ingr = Ingre

Re: How to pass the variable which is defined in the views.py to the jQuery function

2009-01-30 Thread min
Thanks Another problem is that, when I pass the 'variable_to_insert_into_template' to the jQuery function by using var y = {{ variable_to_insert_into_template }}. There is a error in fileBug, which is the invalid property id [Break on this error] var y = {{ variable_to_insert_into_template }}\n

view for page that modifies itself

2009-01-30 Thread adrian
My question is about how to read form items from the POST request before the form is validated. I try to read request.POST['myKey'] and Python says MultiValueDictKeyError: "Key 'myKey' not found in even though Firebug shows the POST request does contain that key. Here's why I want to do this.

Re: Using hashing for password checking in auth module

2009-01-30 Thread Guy Rutenberg
Hi Martin, On Jan 30, 11:43 pm, Martin Conte Mac Donell wrote: > > Actually in contrib.auth passwords are stored in SHA1. If you mean > that passwords are sent in plain text "over the network" then you > should use https. > I meant "over the network". While https is the ideal solution security

Re: Using hashing for password checking in auth module

2009-01-30 Thread Matthias Julius
Guy Rutenberg writes: > Hi Martin, > > On Jan 30, 11:43 pm, Martin Conte Mac Donell > wrote: >> >> Actually in contrib.auth passwords are stored in SHA1. If you mean >> that passwords are sent in plain text "over the network" then you >> should use https. >> > > I meant "over the network". Whil

Re: Has anyone looked into writing an SSH backend for file uploads?

2009-01-30 Thread Jeff FW
Or Samba, too. I suggested sshfs because the OP said "over SSH". Also, it takes *no* set-up on the server--just have ssh running. Not that NFS is hard to set up, of course--just requires some actual work. And who wants to do that? On Jan 30, 11:29 am, Alex Robbins wrote: > It might be even ea

Re: view for page that modifies itself

2009-01-30 Thread adrian
Clues: the POST querydict is empty, so is GET and the HTTP_X_REQUESTED_WITH header is 'XMLHttpRequest' even though I submitted the form with form.submit() in javascript, which should generate an ordinary http request. I don't know if the presence of this header is affecting how django handles

Re: view for page that modifies itself

2009-01-30 Thread adrian
Still curious about the answer, but I've realized I can accomplish what I want by using a URL pattern to pass the data from the URL into the view that way. On Jan 30, 4:15 pm, adrian wrote: > My question is about how to read form items from the POST request > before the form is validated. > I tr

form_for_model

2009-01-30 Thread xankya
hi, I am using django.VERSION (1, 0, 2, 'final', 0). django.forms.form_for_model is not available in this version. can anybody tell me what is the equivalent module name for form_for_module ?? --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: ModelForm and submitting a null value via JSONI

2009-01-30 Thread Daniel Roseman
On Jan 30, 10:01 pm, steve wrote: >  The problem is that the form validation fails. And it's because I'm > sending a blank string in the category field. This field, in the > Ingredient table, is null=TRUE, so I was expecting it to work. > class Ingredient(models.Model): >     name = models.Ch

Re: form_for_model

2009-01-30 Thread Daniel Roseman
On Jan 30, 11:44 pm, xankya wrote: > hi, I am using django.VERSION (1, 0, 2, 'final', 0). > > django.forms.form_for_model is not available in this version. can > anybody tell me what is the equivalent module name for > form_for_module ?? Create a ModelForm instead. See here: http://docs.djangopr

Re: ModelForm and submitting a null value via JSONI

2009-01-30 Thread steve
That's got to be it. Thanks a lot, Daniel. On Jan 30, 4:02 pm, Daniel Roseman wrote: > On Jan 30, 10:01 pm, steve wrote: > > > >  The problem is that the form validation fails. And it's because I'm > > sending a blank string in the category field. This field, in the > > Ingredient table, is nu

free django hosting

2009-01-30 Thread xankya
hi, anybody know free django hosting ? --~--~-~--~~~---~--~~ 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, send emai

Re: Session Variables as Default Form Values

2009-01-30 Thread Todd O'Bryan
You can pass data to a form class as a dictionary, so just save a dictionary of the values in your session under some name that you'll know to use. On Fri, Jan 30, 2009 at 5:04 PM, Tyler Brownell wrote: > http://groups.google.com/group/django-users/browse_thread/thread/ed74391560c762bb > > On Fr

Re: free django hosting

2009-01-30 Thread Jeff Anderson
xankya wrote: hi, anybody know free django hosting ? I highly doubt that there would be free persistent process hosting out there. You might be able to use parts of Django in regular CGI scripts at a free host. Beyond that, you might look into getting a free dynamic dns account and using yo

Re: free django hosting

2009-01-30 Thread Hernan Olivera
try http://www.alwaysdata.com/ 2009/1/30 Jeff Anderson : > xankya wrote: >> >> hi, >> anybody know free django hosting ? >> > > I highly doubt that there would be free persistent process hosting out > there. You might be able to use parts of Django in regular CGI scripts at a > free host. Beyon

Re: free django hosting

2009-01-30 Thread Hernan Olivera
details in http://www.alwaysdata.com/offers/shared/ 2009/1/30 Hernan Olivera : > try http://www.alwaysdata.com/ > > > 2009/1/30 Jeff Anderson : >> xankya wrote: >>> >>> hi, >>> anybody know free django hosting ? >>> >> >> I highly doubt that there would be free persistent process hosting out >>

Re: "setup_environ" can't help to run a standalone script

2009-01-30 Thread Malcolm Tredinnick
On Fri, 2009-01-30 at 04:58 -0800, Orcun Avsar wrote: > im trying to run a seperate script that is on my project directory. > setup_environ seems called correctly but progmram cant import models > properly That likely has nothing at all to do with setup_environ() -- which is only used to set up t

Re: Django Error mails

2009-01-30 Thread Malcolm Tredinnick
On Fri, 2009-01-30 at 05:56 -0800, madhav wrote: > As we all know when any 500 error shows up, django sends an exception > email to all the admins of the site. I was thinking DJango will be > using the smtp library to create mail objects and will be using any > local MTA(sendmail in my case) to se

Re: DateField comparison with date.today()

2009-01-30 Thread Malcolm Tredinnick
On Fri, 2009-01-30 at 15:41 +, Tim Sawyer wrote: > On Wednesday 28 January 2009 04:34:50 Malcolm Tredinnick wrote: > > On Tue, 2009-01-27 at 22:03 +, Tim Sawyer wrote: > > > Hi, > > > > > > I have a model that includes: > > > > > > from datetime import date as pydate, datetime > > > > > >

Re: Missing REFERENCES... in SQL of models.ForeignKey('LaterDefinedModel')

2009-01-30 Thread Malcolm Tredinnick
On Fri, 2009-01-30 at 09:49 -0800, mucisland wrote: > Hi all. > > If I specify the ForeignKey target model as a string because it is not > yet defined, the (SQLite3) SQL table entry misses the REFERENCES > specifier. Example: SQLite doesn't support "references" constraints. So we don't bother wr

Re: Inherit/Override custom Form class methods in a custom ModelForm class

2009-01-30 Thread Malcolm Tredinnick
On Fri, 2009-01-30 at 12:19 -0800, Daniel Roseman wrote: [...] > This is an ideal case for mixins. A mixin is a basic class which is > 'mixed in' to other classes, which inherit both the attributes of > their base class and the mixin class. So, for example, you could do: > > class MyMixin(object)

Re: Missing REFERENCES... in SQL of models.ForeignKey('LaterDefinedModel')

2009-01-30 Thread Malcolm Tredinnick
On Sat, 2009-01-31 at 12:20 +1100, Malcolm Tredinnick wrote: > On Fri, 2009-01-30 at 09:49 -0800, mucisland wrote: > > Hi all. > > > > If I specify the ForeignKey target model as a string because it is not > > yet defined, the (SQLite3) SQL table entry misses the REFERENCES > > specifier. Example

Re: How to pass the variable which is defined in the views.py to the jQuery function

2009-01-30 Thread mili9528
Thank you very much! So you mean if I want pass the 'tags' list to the javascrip, the your code example should be added in the views.py. After that, I can use the list by using var x = {{variable_to_insert_into_template}} in my javascript? Regards Min Quoting Alex Robbins : > > Sorry, a

Change widgets in ModelFormSet

2009-01-30 Thread juanefren
I am using modelformset_factory, to show forms and is working good, my question now is, how can I modify widgets created ? (I want to change the size of the html text elements). This is the documentation about model formsets. http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#id1 Than

Re: Change widgets in ModelFormSet

2009-01-30 Thread Antoni Aloy
2009/1/31 juanefren : > > I am using modelformset_factory, to show forms and is working good, my > question now is, how can I modify widgets created ? (I want to change > the size of the html text elements). Use CSS, javascript o CSS+Javascript. The formeset are generated following alwasy the same

Re: Can I control contents of SELECT in queryset?

2009-01-30 Thread Malcolm Tredinnick
On Fri, 2009-01-30 at 07:46 -0800, phoebebright wrote: > Using your suggestion returns no values: Then there is something else going on in your code that is important and you haven't mentioned yet. If I use exactly the models you give: > class Category(models.Model): > name = models.CharFi

Re: free django hosting

2009-01-30 Thread Jeff Anderson
Hernan Olivera wrote: details in http://www.alwaysdata.com/offers/shared/ Very cool! I don't speak French, but I know enough about words to get the idea. signature.asc Description: OpenPGP digital signature

Re: free django hosting

2009-01-30 Thread felix
http://code.google.com/p/google-app-engine-django/ of course some restrictions apply your mileage may vary felix :crucial-systems.com On Sat, Jan 31, 2009 at 1:12 AM, xankya wrote: > > hi, > anybody know free django hosting ? > > > --~--~-~--~~~---~--~--

django sqlite autoincrement bug

2009-01-30 Thread alexander lind
I am using the svn trunk version of Django. I was just starting a new django project using sqlite for the db backend. Excerpt from models.py: class User(models.Model): user_id = models.AutoField(primary_key=True) This produces a table in sqlite t

Re: django sqlite autoincrement bug

2009-01-30 Thread Malcolm Tredinnick
On Fri, 2009-01-30 at 22:37 -0500, alexander lind wrote: > I am using the svn trunk version of Django. > > I was just starting a new django project using sqlite for the db > backend. Excerpt from models.py: > > class User(models.Model): > user_id =

Re: new record - onetoonefield - create related record

2009-01-30 Thread Karen Tracey
On Fri, Jan 30, 2009 at 4:29 PM, John M wrote: > > Given the model's below, I'm trying to make it add the related 1-1 > record automatically, but it's not working, what am i missing? > Perhaps if you described what "not working" looks like in more detail it would be easier for people to help. I

Re: Using hashing for password checking in auth module

2009-01-30 Thread Guy Rutenberg
Hi Matthias, On Jan 31, 12:37 am, Matthias Julius wrote: > > > But, it doesn't help you anything.  Someone who could get a hold of a > plain text password sent over the internet could get a hashed password > just as easily.  And the server has no way of telling whether the sent > password hash c