regression: Custom Upload Fields

2007-09-14 Thread James Utter
The Custom Upload Fields and Filters at http://code.djangoproject.com/wiki/CustomUploadAndFilters/ (currently version 8) is now broken in the django development version. When you upload an image to a new object in the AutoFileField or AutoImageField, it gets saved with the filename as

Re: file upload/download management in Django

2007-09-14 Thread Peter Baumgartner
> Also, we're looking for a suitable application that can be used for file > upload/download management. There appear to be a number of different > candidates available, so I'd appreciate suggestions. The features we are > looking for are > You may want to check out FileBrowser:

Re: Setting "blank" to one Field?

2007-09-14 Thread r_f_d
I am not sure this is possible, null=True is for the database, while blank=True is for form validation. Also there is a datatype None, there is no datatype blank. If you tried to assign blank as apposed to 'blank' to any variable within python it would complain. If there were not a named

Re: Using a filter with many to many relationship

2007-09-14 Thread r_f_d
You are missing Q. try from django.db.models import Q (I think that is where it resides but cannot verify right now, a quick check of the documentation should confirm) Offer.objects.filter(Q(terms__exact = 'term1') & Q(terms__exact = 'term2') & Q(terms__exact = 'term3)) On Sep 14, 6:46 pm,

Using a filter with many to many relationship

2007-09-14 Thread Merric Mercer
I have a model "OFFER" that has has many to many relationship with a model "TERMS". Class OFFER: terms=models.ManyToMany(Terms) Assuming I have the following value for 3 records in Term term1=2 term2=5 term3=8 I want to return ONLY those offers which have ALL three of these terms .

Re: Reinstalled OS X... what do I need to reinstall?

2007-09-14 Thread Austin Govella
I've done more poking about. Django is totally gone and MySQL isn't running. (May be gone, too.) Is there a way to install django so it doesn't disappear when you reinstall the os? -- Austin Govella Thinking & Making: http://thinkingandmaking.com Thinking Links:

Re: Reinstalled OS X... what do I need to reinstall?

2007-09-14 Thread [EMAIL PROTECTED]
Austin, Just make sure Django is in the site-packages directory of the Python installation that is actually being used. Regards, -scott On Sep 14, 5:06 pm, "Austin Govella" <[EMAIL PROTECTED]> wrote: > They reinstalled OS X on my machine today. > > Runserver tells me "No module named

Re: Using decoupled urls.py and generic views

2007-09-14 Thread Nathaniel Whiteinge
Whoops, mind the typo. Should be:: urlpatterns = patterns("xgm.AbbrDB.views", (r"^$", "search"), ) urlpatterns += patterns("django.views.generic.list_detail", (r'^list/$', 'object_list', info_dict), ) --~--~-~--~~~---~--~~ You

Re: Using decoupled urls.py and generic views

2007-09-14 Thread Nathaniel Whiteinge
If you're only doing one or two, use callables [1]_ which will ignore your view prefix:: from django.conf.urls.defaults import * from models import Abbreviation import django.views.generic.list_detail.object_list as object_list info_dict = { "queryset":

Reinstalled OS X... what do I need to reinstall?

2007-09-14 Thread Austin Govella
They reinstalled OS X on my machine today. Runserver tells me "No module named django.core.management" and web research suggests that means I need to reinstall python 2.4. >From your experience, is there anything else I need to reinstall? Should I reinstall django, too? (If I wanted to

Re: Having Django iterate through JSON possible?

2007-09-14 Thread Richard Dahl
sure, I am using the YUI tree to display a tree of assets and thier associated children, i.e. the 'Devices' node of the tree has 'www.acme.com' and ' db1.acme.com' underneath it. Clicking on the tree parent utilizes the builtin YUI function to expand the tree which sends an async (Xml HTTP

Re: Having Django iterate through JSON possible?

2007-09-14 Thread olivier
> To Olivier: Iterating through javascript like that is possible, but it > poses a disadvantage in that I cannot access the data's related object > (e.g. ForeignKey relationships). > For example I can do data[0].fields.user and I'd get "3" as a > response, but I cannot do

Re: Having Django iterate through JSON possible?

2007-09-14 Thread robo
Hi Richard, Can you give an example of what you are suggesting? > One thing that you can do is to pass a > render_to_response call a template and the python dictionary you want > modified and let django work its majic on it before returning the > '._container' to the page via json. Thanks. To

CREATIVE WRITING

2007-09-14 Thread shamsee26
*Creative Writing Skill is not heriditary. We may learn it. * * * *http://www.100stuff.com/sdk/creative-writing/* *--* --~--~-~--~~~---~--~~ You

Re: Having Django iterate through JSON possible?

2007-09-14 Thread r_f_d
The big issue here would be why to do that. If you are doing this synchronously, why put the data into a json object. Just pass a dictionary and do what yo will. If you are doing this ansynchronously (ala AJAX) then the page will not reload and the template will already be compiled and unable

Best Download Softwares

2007-09-14 Thread shamsee26
*Disk Cloning Tools, Registry Cleaners, Graphic Design, Tweaking, Hard Disk Tools and Registry Repair Softwares: ** * *http://www.gobsmack.info/software-download/cCleaner*

Setting "blank" to one Field?

2007-09-14 Thread Xan
Hi, Following the database API reference (http://www.djangoproject.com/ documentation/db-api/): If a ForeignKey field has null=True set (i.e., it allows NULL values), you can assign None to it. Example: e = Entry.objects.get(id=2) e.blog = None

Taking data from and uploaded file and distributing it to the database

2007-09-14 Thread jacoberg2
I am relatively new to django nad i was wondeirng if anyone knew how to open and read the files taht have been uploaded to the site. I have tried the following code in the save method of my filefield model. The problem is that you have to save the file to the system and then try to manipulate it,

Re: Having Django iterate through JSON possible?

2007-09-14 Thread olivier
Hi, > I am able to send JSON data from Django to my javascript function, but > I would like to iterate JSON by using the Django template language. Is > this possible at all? No, it's not. Javascript works on the client side and doesn't know anything about the way the server did generate the

Having Django iterate through JSON possible?

2007-09-14 Thread robo
Hi, I am able to send JSON data from Django to my javascript function, but I would like to iterate JSON by using the Django template language. Is this possible at all? For example, my view passing JSON back: def ajax_form_test(request): data = serializers.serialize("json",

Re: Arithmetic operations in a templete

2007-09-14 Thread [EMAIL PROTECTED]
On Sep 14, 12:46 pm, "Jonathan Buchanan" <[EMAIL PROTECTED]> wrote: > I'd have to take a look at how that tag was implemented, but I'd > likely start out with something horrific, like the attached patch :D Tsk, tsk. Bending the rules of the game a bit now, aren't we? :-) Again, yes, you could

Re: Arithmetic operations in a templete

2007-09-14 Thread Jonathan Buchanan
On 9/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On Sep 14, 11:29 am, "Jonathan Buchanan" <[EMAIL PROTECTED]> > wrote: > > Pesky kids these days, with your music and your anticipation... > > :-) > > > I agree that what you propose here would be useful in the scenario > > you've

file upload/download management in Django

2007-09-14 Thread Faheem Mitha
Dear Django Users, I've been given the task of developing a web application at work. This is for uploading/downloading large data files, specifically microarray data files for bioinformatics work. I've been looking at Django and managed to get some basic framework stuff working, using the

Using decoupled urls.py and generic views

2007-09-14 Thread Florian Lindner
Hello, part 3 of the tutorial introduced how to decouple URL configuration into the app dir. At part 4 [1] generic views are introduced and the decoupled URL configuration: from django.conf.urls.defaults import * urlpatterns = patterns('mysite.polls.views', (r'^$', 'index'),

Re: Arithmetic operations in a templete

2007-09-14 Thread [EMAIL PROTECTED]
On Sep 14, 11:29 am, "Jonathan Buchanan" <[EMAIL PROTECTED]> wrote: > Pesky kids these days, with your music and your anticipation... :-) > I agree that what you propose here would be useful in the scenario > you've described. *Personally*, if I wanted something like that, I'd > just write a

Re: Arithmetic operations in a templete

2007-09-14 Thread Jonathan Buchanan
> Thanks for the response. But to be fair to you I must disclose that I > anticipated that someone would present this as an answer. I would have > added this discussion into the original but it was already a bit > long... :-) Pesky kids these days, with your music and your anticipation... > Now

Re: Uploading files

2007-09-14 Thread Russell Keith-Magee
On 9/14/07, Dushyant Sharma <[EMAIL PROTECTED]> wrote: > > def thing_add(request): > if request.method == 'POST': > new_data = request.POST.copy() > new_data.update(request.FILES) This example is incorrect for the current trunk version of Django. You don't update the

Re: Arithmetic operations in a templete

2007-09-14 Thread [EMAIL PROTECTED]
On Sep 14, 9:31 am, "Jonathan Buchanan" <[EMAIL PROTECTED]> wrote: > > Template tags really are the best place to put display-specific logic > like this. The original problem specified (a custom button and > associated JavaScript for an object with the object's name in the > button's id) could be

concatenating querysets

2007-09-14 Thread hajo
I have a search function on my site. A user needs to be able to input multiple words that are then searched for in multiple text fields. My issue is the following: my function works very well for a single word or for the last word of a search as the queryset gets overwritten. I understand what is

Re: Validating dynamically generated fields (guess i'll need a metaclass)

2007-09-14 Thread JeffH
I agree with Doug B's advice - I've used that "list of forms with different prefixes" technique and it works very well and the code should be easy for others to follow down the road. You actually don't need a prefix hidden field for each fieldset - one hidden field containing the number of

Re: Arithmetic operations in a templete

2007-09-14 Thread Jonathan Buchanan
> However, simply dodging the question doesn't address the original point: > why does Django adhere to such a nannyish philosophy, and how do you > solve the problem I presented *within Django* in a reasonable way? > > Thanks and regards, > -scott anderson Template tags really are the best place

Re: Validating dynamically generated fields (guess i'll need a metaclass)

2007-09-14 Thread [EMAIL PROTECTED]
On Sep 13, 11:06 pm, Doug B <[EMAIL PROTECTED]> wrote: > Could you just use a collection of forms with different prefixes... Hi Doug, that's a good idea... but i'm still following the meta-programming route... i tried with a form factory function which is conceptually closer to what i thought

Re: ANN: Making some changes to djangoproject.com

2007-09-14 Thread Jarek Zgoda
Tim Chase napisał(a): > - the addition of Cobol data-stores and hierarchical databases - ability to write code in positional way, like in RPG/400 -- Jarek Zgoda Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101 "We read Knuth so you don't have to." (Tim Peters)

Re: ANN: Making some changes to djangoproject.com

2007-09-14 Thread TheMaTrIx
Rewrote Django in PHP. Rewrote Django in ASP. Rewrote Django in Java. Dropped Django development and defected to Ruby on Rails. Rewrote Django to be the root of all online evil (but then again, doing any of the above would qualify it for this by default :p) If your server move messages have

size of urls.py

2007-09-14 Thread Dushyant Sharma
is there any performance bottleneck when the size of urls.py goes large. if yes how to overcome that. also if we use same url for a particular group, based on some hidden action variable in htmls, would it improve performance. like i am using if request.method == 'POST': action =

Re: ATTN: (NOT) Moving djangoproject.com to a new server!

2007-09-14 Thread TheMaTrIx
Hrm, I ran Django on configs from old to bleeding edge python, mod_python and apache and haven't had a problem with the auth layer (aka apache 2.2, python 2.5.1, latest mod_python etc) What trouble is it giving you? On Sep 14, 8:32 am, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote: > Hi all --

Re:

2007-09-14 Thread TheMaTrIx
I wish google would finaly start enabling their Gmail spam filters on these frigin boards. Spam is getting rediculous. On Sep 14, 11:38 am, "Useful Database" <[EMAIL PROTECTED]> wrote: > Hello friends and group members, > > I recently happened to see the below information ... just thought that

Re: Arithmetic operations in a templete

2007-09-14 Thread Scott Anderson
Yes, that's always the fall back, isn't it? I'll look at Jinja, as I didn't realize there was such a fork. Apparently I'm not the only one who thinks this way. I'm concerned with how well a solution like this tracks the Django release. However, simply dodging the question doesn't address the

Re: Arithmetic operations in a templete

2007-09-14 Thread Scott Anderson
Thank you, but that's exactly what I said I *didn't* want to do, because it's silly. :-) Why should my *data model* know *anything* about the presentation? And what happens when I want a parrot row ID, or a parrot foo ID, or a parrot cheese ID? Suddenly I have a proliferation of things in my

Re: Site level data models

2007-09-14 Thread Stewart
Excellent. A little bit of experimentation later and I see I can then import core models into another app with "import sitename.core.models" Many thanks. On Sep 14, 11:35 am, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > I always have an app called "core" for that kind of stuff, like non-app >

Re: Site level data models

2007-09-14 Thread Chris Hoeppner
I always have an app called "core" for that kind of stuff, like non-app related views, forms, middleware, models... etc. El vie, 14-09-2007 a las 03:09 -0700, Stewart escribi�: > Hi > > I'm considering writing an web application in Django but I'm a little > confused about the Site-App model. >

Re: User session variable in view

2007-09-14 Thread Dushyant Sharma
use RequestContext http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext pass request object to it c= RequestContext(request, {other objects}) then you can use user.fieldname in your view --~--~-~--~~~---~--~~ You

Site level data models

2007-09-14 Thread Stewart
Hi I'm considering writing an web application in Django but I'm a little confused about the Site-App model. Say, for instance, I am writing a site that has both a blog and a forum application. Each application has its own data models, but there is also some data that is common between both. Is

FREE PS3 or XBOX 360 ELITE or many more! As seen on BBC Newsnight!!

2007-09-14 Thread senjie49
As shown on BBC Newsnight, you can receive many free items! If you don't believe me check out this video: http://www.youtube.com/watch?v=JQao7pzpqm8 It has been proven to work!! I have already completed one of these and received an iPod and a PS3, so I know it works! All you have to do is follow

Re: User session variable in view

2007-09-14 Thread Jarek Zgoda
Rufman napisał(a): > in temlates user information is stored in the variable user. how can i > access this data in a view. (im guessing it must be a session > variable, but i haven't found any precise information) Check the user attribute of request object. -- Jarek Zgoda Skype: jzgoda |

User session variable in view

2007-09-14 Thread Rufman
in temlates user information is stored in the variable user. how can i access this data in a view. (im guessing it must be a session variable, but i haven't found any precise information) thx for the help stephane --~--~-~--~~~---~--~~ You received this message

Re: about get_cfg_var () function

2007-09-14 Thread Horst Gutmann
bjlinwu wrote: > echo get_cfg_var("register_globals"); > Why it doesn't output anything? > O_o ... and you're completely sure that you wrote this to the right mailing list? ;-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: ifequal function not working?

2007-09-14 Thread Nis Jørgensen
John M skrev: > the ID is the primary key ID generated by django on models. > > basically, it's not the syntax im having issue with, i think the > selected_id is being passed / parsed as a string not an intenger like > ID is. > So where do you get the selected_id from? GET/POST variables are

Forms and unique fields

2007-09-14 Thread Thijs Thiessens
Hi! I have a model which contains among others a unique email field. However this field has no corresponding form validating field. Is that correct? I have seen that I can make a custom validating field which probably should query the database to see if the email exists but having seen the

[no subject]

2007-09-14 Thread Useful Database
Hello friends and group members, I recently happened to see the below information ... just thought that it could be useful to you people ... Thanks. -- *Introducing for the first time in

Re: Uploading files

2007-09-14 Thread Dushyant Sharma
class ThingForm(forms.Form): name = forms.CharField(max_length=30, required=True, label=_('Name of the thing')) photo = forms.Field(widget=forms.FileInput, required=False, label=_('Photo'), help_text=_('Upload an image (max %s kilobytes)' % settings.MAX_PHOTO_UPLOAD_SIZE)) def

Re: Arithmetic operations in a templete

2007-09-14 Thread Samuel Adam
no, Scott, you should just do *this*: In your Parrot model, you could add a property that displays your DOM id. class Parrot(models.Model): # fields def _domid(self): return ''parrotButton-%s" % self.id domid = property(_domid) and use parrot.domid in your templates. On

about get_cfg_var () function

2007-09-14 Thread bjlinwu
echo get_cfg_var("register_globals"); Why it doesn't output anything? --~--~-~--~~~---~--~~ 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

Re: Deleting the relations and not the objects?

2007-09-14 Thread Nis Jørgensen
Xan skrev: > class Aclass(models.Model): > be = models.ForeignKey('B') > ce = models.ManytoManyfield('C') > > class B(models.Model): >[...] > > class C(models.Model): > [...] > > Suppose that with admin interface, I put: > be = b1 (b1 is B) > ce has c1, c2,

Re: Uploading files

2007-09-14 Thread Jarek Zgoda
Jarek Zgoda napisał(a): >> I am using Django 0.97 pre in winxp. database is mysql. Please >> forgive any errors or if I am not clear with some aspects as I am a >> beginner trying to learn django. I am trying to upload a file: an >> image. I am not worried about validation now. I want to know

Re: Uploading files

2007-09-14 Thread Jarek Zgoda
AniNair napisał(a): > I am using Django 0.97 pre in winxp. database is mysql. Please > forgive any errors or if I am not clear with some aspects as I am a > beginner trying to learn django. I am trying to upload a file: an > image. I am not worried about validation now. I want to know how to do

Uploading files

2007-09-14 Thread AniNair
Hello, I am using Django 0.97 pre in winxp. database is mysql. Please forgive any errors or if I am not clear with some aspects as I am a beginner trying to learn django. I am trying to upload a file: an image. I am not worried about validation now. I want to know how to do this. I tried to do

Managers and indirection

2007-09-14 Thread Scott Kilpatrick
Been thinking about how I could do this for a while now to no avail, so maybe one of you can help me out. I have a m2m with intermediate model like so: class Venue(models.Model): ... class Artist(models.Model): ... class Event(models.Model): venue = models.PrimaryKey(Venue)

Re: ATTN: (NOT) Moving djangoproject.com to a new server!

2007-09-14 Thread Jacob Kaplan-Moss
Hi all -- OK, so I've run into some problems setting up the new box, so this isn't going to happen tonight. (If anyone can help me get Django's authentication handler working with Apache 2.2 / mod_python 3.3, please get in touch!) So chances are I'll put this off until after the sprint. Sorry