Re: Creating test databases. Nose framework

2009-01-29 Thread Oleg Oltar
> > Generally, you'll want to wait more than 6 hours before asking again. A > couple of days, at least, would be a reasonable period. > Sorry...Will note On Thu, Jan 29, 2009 at 2:54 AM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Wed, 2009-01-28 at 17:19 +0200, Oleg Oltar

Re: can i use models like that??

2009-01-29 Thread bruno desthuilliers
On 28 jan, 23:09, Mirat Can Bayrak wrote: > Can you look at these, can they work? > > i tried that one but not worked, is there way to make it working? (nope, > there was no error messages, only strings are not shown at admin panel) > > LANGUAGE_OPTIONS = (('en_GB',

pb synchronize database to django

2009-01-29 Thread arbi
Hi, I am a newb in Django and I find it very nice... But the current problem is that, when I try to synchronize my models (using python manage.py syncdb), an attribute that I changed did not change in my database. For instance : class Route (models.Model) : name=. attribute 2

Re: pb synchronize database to django

2009-01-29 Thread Daniel Roseman
On Jan 29, 9:07 am, arbi wrote: > Hi, > > I am a newb in Django and I find it very nice... But the current > problem is that, when I try to synchronize my models (using python > manage.py syncdb), an attribute that I changed did not change in my > database. For instance : >

Re: How to do Refbacks in Django?

2009-01-29 Thread Fluoborate
Yes, thank you, but I already figured that out and made a stupid function add_to_log(request). What I am really wondering is, how do I avoid having to call add_to_log(request) in every single view function in views.py? Thanks. On Jan 28, 8:04 pm, Malcolm Tredinnick

Re: How to do Refbacks in Django?

2009-01-29 Thread Fluoborate
Oh wait, you told me that too: MIDDLEWARE Okay, I'm all set, thanks so much. --~--~-~--~~~---~--~~ 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

Re: 'FtrToolTags' is not a valid tag library: Could not load template library from django.templatetags.FtrToolTags, cannot import name Product

2009-01-29 Thread Thiago F. Crepaldi
Hello, in my templates pages, i do: {% load FtrToolTags %} in my FtrToolTags, i do: from webTool.ftrTool.models import Product i also use Product model on admin.py, forms.py, views.py and models.py Thanks, Thiago On Jan 28, 11:21 pm, Malcolm Tredinnick wrote: > On

Re: template: writing "\u20ac 20.000" fails

2009-01-29 Thread SanPy
Well, I thought it didn't escape the input string. I was wrong. I tried `escape_js` again and now it works just fine. It probably did before, but I don't remember why I thought it didn't. Regards, Sander On 28 jan, 04:28, Malcolm Tredinnick wrote: > On Tue, 2009-01-27

Re: Search in a ManyToManyField in Admin interface

2009-01-29 Thread João Olavo Baião de Vasconcelos
On Wed, Jan 28, 2009 at 7:36 PM, Ian wrote: > Yes, that's the problem. The admin automatically adds .distinct() to the > queryset whenever one of the search fields is in a related model, which > would trigger the error. Ok, got it. > This is a limitation of Oracle,

Re: 'FtrToolTags' is not a valid tag library: Could not load template library from django.templatetags.FtrToolTags, cannot import name Product

2009-01-29 Thread Thiago F. Crepaldi
Well, i figured it out. As i said before, i upgraded from django 0.97 (svn) to 1.0.2 stable, BUT i didn't rebooted my server. So, when i looked at META INFORMATION in my browser, i saw that 0.97 version still being used, instead of the new version. I rebooted it and everything is normal again.

Re: @cache_control() and @never_cache not working

2009-01-29 Thread Tomas Kopecek
In that version (0.96) of Django was bug in combination of these decorators and CacheMiddleware. If you can use upstream version then everything will be working. Otherwise look for these (closed) tickets on http://code.djangoproject.com and patch your version. Tomas Kopecek

#7210 - F() Query Expressions

2009-01-29 Thread Russell Keith-Magee
Hi all, With [9792], I've committed F() query expressions to trunk. For details, see the docs: http://docs.djangoproject.com/en/dev/topics/db/queries/#filters-can-reference-fields-on-the-model There are two caveats worth knowing about: 1) This patch reveals a bug in the SQLite package that

Admin screen counts correctly but returns no records

2009-01-29 Thread JonUK
I'm creating a new admin UI for User, separate to the standard admin User interface - I have the following setup: class WebsiteUser( User ): class Meta: db_table = 'auth_user' class WebsiteUserAdmin( admin.ModelAdmin ): list_display = ( 'username', ) admin.site.register(

Re: Admin screen counts correctly but returns no records

2009-01-29 Thread Daniel Roseman
On Jan 29, 12:00 pm, JonUK wrote: > I'm creating a new admin UI for User, separate to the standard admin > User interface - I have the following setup: > > class WebsiteUser( User ): >     class Meta: >         db_table = 'auth_user' > > class WebsiteUserAdmin(

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

2009-01-29 Thread Andrew Ingram
Hi All, At the moment our Django apps run on the same server that the static images are served from, we are looking to change this to improve redundancy. Has anyone created (or attempted to create) a new file backend that uses SSH? Ideally you'd be able to provide it with a tuple of machines

Re: Admin screen counts correctly but returns no records

2009-01-29 Thread JonUK
Thanks Daniel, I'll take your advice. I'm surprised (i.e. don't understand why) this approach is problematic though. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

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

2009-01-29 Thread Christian Joergensen
Andrew Ingram wrote: [...] > Ideally you'd be able to provide it with a tuple of machines to > connect to which would allow you to upload to all the machines at once > (but even if there's one that only allows you to upload to one machine > that would still be useful). What if one of the

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

2009-01-29 Thread Andrew Ingram
On Jan 29, 1:19 pm, Christian Joergensen wrote: > What if one of the machines was unresponsive at the time of the upload? One option would be to have all the files uploaded locally, but the handler would additionally copy to the other locations. The other would just to be to have

Re: absolute_import, app names, dots, and a bug

2009-01-29 Thread Todd O'Bryan
On Wed, Jan 28, 2009 at 11:49 PM, Malcolm Tredinnick wrote: > > On Wed, 2009-01-28 at 22:50 -0500, Karen Tracey wrote: >> >> No, I don't think that's an accurate representation of the status. >> The triage state is Accepted and furthermore Malcolm even assigned it >> to

Re: Django Forms in HTML 4.01 Strict

2009-01-29 Thread Gertjan Klein
Malcolm Tredinnick wrote: >On Wed, 2009-01-28 at 14:33 +0100, Gertjan Klein wrote: >> Malcolm Tredinnick wrote: >> >> I disagree. When I develop web pages (using Django or otherwise) I use >> the Firefox HTML validator extension. This helps me write >> standards-compliant HTML -- a big red

Re: Getting Logged in User with Test Client

2009-01-29 Thread Vitaly Babiy
Malcolm thanks for the feedback and your right, I agree with you that the client should not know about the user. Vitaly Babiy 2009/1/26 Malcolm Tredinnick > > On Sat, 2009-01-24 at 12:14 -0500, Vitaly Babiy wrote: > > Yes either way would work I was just wondering if

Re: Django Forms in HTML 4.01 Strict

2009-01-29 Thread Andrew Ingram
On Jan 29, 2:18 pm, Gertjan Klein wrote: > This payment thing comes up regularly here, and pollutes the discussion. > I have been using Django for a while, and found it to have good things > and downsides (both IMHO). I have not even critisized Django here (yet > ;)), just

Can I control contents of SELECT in queryset?

2009-01-29 Thread phoebebright
I want a distinct list of all the 'cat__names' that exist in Subcategory and have at least one entry in Business (Business is a subclass of model Directory which might be the problem) dir_query = Business.objects.all().select_related().distinct() ... subcats =

Re: Any django users in Malaysia/Singapore

2009-01-29 Thread digicase
Hi, I'm in Singapore. I'm building a django/satchmo site right now. I have worked on about ten Django sites in the past, and for a Singapore client in particular we just completed http://www.asiansecurity.org/ Good to know there are other Django users here! Cheers, Arthur On Jan 29, 2:00 pm,

Three table Lookup Question

2009-01-29 Thread Kyle
Hello! I am trying to get a list of "Projects" based on certain "Industry". (My naming convention, not django's) My models look like this: http://dpaste.com/114308/ "Project" has a foreign key to "Campaign". "Industry" also has a foreign key to "Campaign". Does it matter if both

Re: Custom Template Tag - Passing variable for use in tag processing

2009-01-29 Thread phoebebright
You understood perfectly. It was just another case of my not understanding the documentation. Your explanation makes perfect sense. Many thanks. On Jan 27, 6:45 pm, Eric Abrahamsen wrote: > On Jan 28, 2009, at 1:52 AM, phoebebright wrote: > > > > > > > I have duplicated as

middleware response processing always occurs

2009-01-29 Thread George Lund
We recently uncovered a bug in our code, which was pretty confusing, and is explainable only via the fine-print of http://docs.djangoproject.com/en/dev/topics/http/middleware/ -- and reading through the Django source. So I thought I'd share, and maybe a Django developer might comment on whether

Re: Can I control contents of SELECT in queryset?

2009-01-29 Thread Almost George
On Jan 29, 8:44 am, phoebebright wrote: > I want a distinct list of all the 'cat__names' that exist in > Subcategory and have at least one entry in Business (Business is a > subclass of model Directory which might be the problem) > > dir_query =

Re: links in table - one for URL, one not

2009-01-29 Thread May
Thanks all! I needed to put the curly brackets around the website variable. Dumb mistake on my part. It works now! Thanks! {{ researchproject.institution| > > safe }} On Jan 28, 2:15 pm, Karen Tracey wrote: > On Wed, Jan 28, 2009 at 4:28 PM, May

Re: can i use models like that??

2009-01-29 Thread Mirat Can Bayrak
well thank you, what do you think about this one? is that possible? class Product(models.Model): name = models.CharField(max_length=50) slug = models.SlugField() preview_animation = models.ImageField(upload_to = "animations") class Game(Product) another_properties =

Re: views, templates, render and groups

2009-01-29 Thread garagefan
ok... i'm trying to use exclude in the query set to get this to work. I'm not entirely sure how my logic should go though... especially since i would be comparing to lists that would result in <> not being usable... since a user and a group won't contain the same set of groups. is it possible

Re: Changing comments preview form

2009-01-29 Thread Florian Lindner
Am 29.01.2009 um 01:59 schrieb Malcolm Tredinnick: > > On Wed, 2009-01-28 at 19:24 +0100, Florian Lindner wrote: >> >> Am 28.01.2009 um 05:19 schrieb Malcolm Tredinnick: >> >>> >>> On Tue, 2009-01-27 at 20:11 +0100, Florian Lindner wrote: Hello, I'm playing around with the

Re: media files apache/modpython windows

2009-01-29 Thread May
Ok, I think I finally got it! In order to use my css template as a django inherited base.html(which is under folder-template) I have to place my html(ex. index.html) pages under the same folder "template", which is specified as a directory path in the settings.py file under TEMPLATE_DIRS:

Sending emails through Microsoft Exchange in django?

2009-01-29 Thread Bryant
Hi all, I was just wondering if anyone has tried sending mail through Microsoft exchange. What information do I need, and will it work with django's smtp functions? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Can I control contents of SELECT in queryset?

2009-01-29 Thread phoebebright
That's an interesting post but I havn't managed to get it to solve my problem because I'm looking for a list of all categories and that method using FOO_set only seems to work on a single object (get). Also tried the raw sql method but I get an SQL error (1064, "You have an error in your SQL

Re: #7210 - F() Query Expressions

2009-01-29 Thread koenb
This is really great! Thanks all for the good work. Just curious, has there been any work done to make this also work for dates ? like in longevents = Event.objects.filter(enddate__gte=F('startdate')+10) or something like that ? Koen --~--~-~--~~~---~--~~ You

Re: Custom Template Tag - Passing variable for use in tag processing

2009-01-29 Thread phoebebright
This is the final code which works in case it helps anyone else. Thanks again. In the template: {% page_links category %} In templatetags file @register.tag(name="page_links") def get_page_links(parser,token): tag_name, category = token.contents.split() return

order by count

2009-01-29 Thread lollerikken
Hello, sorry about my English, but I hope that it is understandable I am having some trouble using order_by with Django. I think it would be easier to explain what I want with an example: fx if I have this table: key ref 1 a 2 g 3 a 4 c 5 g 6 g I would like to sort it like this:

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

2009-01-29 Thread Adam Stein
According to the docs, when using 'contains' in filter() a percent sign or underscore is automatically escaped. However, in my case I want the resulting SQL to use the percent sign. I know 'contains' will fill in the outside percent signs, but it escapes the percent sign in my string. So that

Cron Job Question

2009-01-29 Thread Chris
I have a python / django script that I have written which will be used as a cron. Basically this script goes out to my database and gets rows from a given table and performs a specific task then deletes the row once finished. What I would like to do is have multiple instances of this script

Re: Custom authentication backend and User passwords

2009-01-29 Thread Delta20
Thanks Malcolm. For anyone interested in this topic, I have created a snippet with my solution: http://www.djangosnippets.org/snippets/1301/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Cron Job Question

2009-01-29 Thread Jeff Anderson
Chris wrote: > I have a python / django script that I have written which will be > used as a cron. Basically this script goes out to my database and gets > rows from a given table and performs a specific task then deletes the > row once finished. What I would like to do is have multiple instances

Re: Three table Lookup Question

2009-01-29 Thread Todd O'Bryan
I'm not sure I understand what you're asking, but projs = Project.objects.filter(campaign__industry=x) where x is one of 1-6 should do what you want, I think. Is that what you were asking? On Thu, Jan 29, 2009 at 9:54 AM, Kyle wrote: > > Hello! > > I am trying to get a

reason for missing readline() in uploaded files?

2009-01-29 Thread Todd O'Bryan
I'm trying to validate an uploaded csv file, so I want to read the first line of text and if it's not the right format, send an error message. Unfortunately, neither InMemoryUploadedFile nor TemporaryUploadedFile have the readline() method. Was that an oversight (in which case I'll create a

Finding and Displaying the Object that a Comment is Created On

2009-01-29 Thread dave.mer...@gmail.com
This si a somewhat nooby question. I have a comment. I want to display the post title for the comment.object_id. In the template I have been trying things like comment.post.title, but that is not working. I think it is due to the fact that Comments use a generic foreign key. So... how do I do

Re: order by count

2009-01-29 Thread Brandon Taylor
Hello, You can use the sorted() function in Python to order any iterable. It asks for a key to order by, which can be a lambda, or you could use the operator module to get attributes of the object(s) in your QuerySet object to provide the key. My $0.02, Brandon On Jan 29, 12:38 pm, lollerikken

Re: Finding and Displaying the Object that a Comment is Created On

2009-01-29 Thread alex.gay...@gmail.com
On Jan 29, 3:48 pm, "dave.mer...@gmail.com" wrote: > This si a somewhat nooby question. > > I have a comment. I want to display the post title for the > comment.object_id. > > In the template I have been trying things like comment.post.title, but > that is not working. > >

Re: Expression Engine for Django?

2009-01-29 Thread Sean Perry
On Thu Jan 29 13:49 , "maltebeckm...@mac.com" sent: > >I am an Expression Engine (CMS) fan who recently got convinced that >Python is way cooler than PHP. Problem is that Expression Engine is >written in PHP. > >Is there an Expression Engine for Django, i.e. an installation package >that can

guidance on serialization

2009-01-29 Thread Jason Geiger
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_length=20) width = models.IntegerField() class

FormWizard accessing previous fields data

2009-01-29 Thread lbologn...@gmail.com
Hi all, say i have a FormWizard of 5 steps and at the last step i want to display a summary of the submitted data how do i access the value of a field that was in the form at step 1? example: class Step1(Form): foo = CharField() bar = CharField() So at step 5 i'd like to display the value

Re: Improving the response time in Django Admin

2009-01-29 Thread Tipan
> > Without specifics, it's a little difficult to say for certain, but one > of the reasons for the switch to newforms and newforms-admin was to > eliminate some very expensive querying behavior in the manipulators > behind forms. This wasn't a matter of one big query that was expensive > - but

Re: Improving the response time in Django Admin

2009-01-29 Thread Karen Tracey
On Thu, Jan 29, 2009 at 5:49 PM, Tipan wrote: > I'll go ahead as planned on the Django update and see if this delivers > any improvements. With regards to your suggestion of using the raw id > field, is this a Django option, or did you mean changing the FK to > using a simple

Apps and static/media files

2009-01-29 Thread Erik Allik
I'm having a situation in which two of my reusable apps both use FCKeditor in their admin interface. Since both of them require FCKeditor library files, I'm confused which one should provide them? Both? How? What is the idiomatic/standard way of doing this? Should I instead have them both

Re: ContentTypes and fixtures

2009-01-29 Thread felix
this has bitten me too recently. in general I'm moving away from fixtures. they are breakable, they suffer when the codebase is refactored. particularily for tests I no longer use fixtures. I would suggest trying the dump-to–python-code method ideally there should be a away to dump a group

Re: order by count

2009-01-29 Thread lollerikken
The problem with the sorting method is that I think it will take to much time. I would like if it could happen as part of the query. "operator module to get attributes of the object(s) in your QuerySet", I'm not sure I know how to do this. I have tried writing it as SQL with cursor:

Re: #7210 - F() Query Expressions

2009-01-29 Thread Russell Keith-Magee
On Fri, Jan 30, 2009 at 2:47 AM, koenb wrote: > > This is really great! Thanks all for the good work. > > Just curious, has there been any work done to make this also work for > dates ? > > like in > > longevents =

Re: passing self?

2009-01-29 Thread ajlozier
Hi Malcolm, I figured it out. This article is what pointed me in the right direction: http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/ While you are right that there are a lot of examples in the code of something similar, and that, in theory, I should be able to find the answer to any

Re: Three table Lookup Question

2009-01-29 Thread Kyle
Yes, almost. It got me to understand the correct syntax. I noticed that my results were coming according to Industry's primary key, rather than the Industry integer field, so I appended another __industry Here is the solution: Project.objects.filter(campaign__industry__industry=x) Thank you

Re: Meta-information for model and form fields

2009-01-29 Thread Malcolm Tredinnick
On Wed, 2009-01-28 at 23:21 -0800, Vinay Sajip wrote: [...] > I was hoping there was another way. Of course subclassing's not hard > to do, but it means doing it for every field class. I was looking at > moving an application over from SQLAlchemy, which offers this feature > both for models and

Re: error when using delete generic views

2009-01-29 Thread Malcolm Tredinnick
On Wed, 2009-01-28 at 23:47 -0800, Daniel Roseman wrote: [...] > No, you have provided four keyword arguments. The signature for the > delete_object function is as follows: > def delete_object(request, model, post_delete_redirect, > object_id=None, > slug=None, slug_field='slug',

Re: Complex queries with datetime field

2009-01-29 Thread Malcolm Tredinnick
On Thu, 2009-01-29 at 09:48 +0100, Stefan Tunsch wrote: > Well, first of all I can't believe I've overlooked the __in field > lookup... I wasn't aware of it's existance. Sorry. > > Regarding the __year, __month and __day lookups I'm using in my code: > I do it because I want to filter all

Re: form for two models - reuse fields generated by modelform

2009-01-29 Thread Malcolm Tredinnick
On Thu, 2009-01-29 at 03:56 -0800, Markus Bertheau wrote: > Hi, > > I need a registration form that allows the user to input several > models. Now just creating two ModelForms and letting a third class > inherit from them doesn't work, the fields of one model don't show. Is > there another way

Re: Django Forms in HTML 4.01 Strict

2009-01-29 Thread Malcolm Tredinnick
On Thu, 2009-01-29 at 06:36 -0800, Andrew Ingram wrote: > On Jan 29, 2:18 pm, Gertjan Klein wrote: > > This payment thing comes up regularly here, and pollutes the discussion. > > I have been using Django for a while, and found it to have good things > > and downsides (both

charts in django

2009-01-29 Thread Chris Haynes
I need to generate some line charts and bar graphs from django. I recall seeing a very promissing package a couple months ago and can't find it now. There's pychart, but it hasn't been maintained for a couple years and I question its staying power, and it just generates images. open-flash- chart

Re: Can I control contents of SELECT in queryset?

2009-01-29 Thread Malcolm Tredinnick
On Thu, 2009-01-29 at 06:44 -0800, phoebebright wrote: > I want a distinct list of all the 'cat__names' that exist in > Subcategory and have at least one entry in Business (Business is a > subclass of model Directory which might be the problem) > > dir_query =

Re: Cron Job Question

2009-01-29 Thread Malcolm Tredinnick
On Thu, 2009-01-29 at 11:34 -0800, Chris wrote: > I have a python / django script that I have written which will be > used as a cron. Basically this script goes out to my database and gets > rows from a given table and performs a specific task then deletes the > row once finished. What I would

Re: reason for missing readline() in uploaded files?

2009-01-29 Thread Malcolm Tredinnick
On Thu, 2009-01-29 at 15:40 -0500, Todd O'Bryan wrote: > I'm trying to validate an uploaded csv file, so I want to read the > first line of text and if it's not the right format, send an error > message. Unfortunately, neither InMemoryUploadedFile nor > TemporaryUploadedFile have the readline()

Re: Apps and static/media files

2009-01-29 Thread Malcolm Tredinnick
On Fri, 2009-01-30 at 00:57 +0200, Erik Allik wrote: > I'm having a situation in which two of my reusable apps both use > FCKeditor in their admin interface. Since both of them require > FCKeditor library files, I'm confused which one should provide them? > Both? How? What is the

Re: charts in django

2009-01-29 Thread Ned Batchelder
Pygooglechart is a good interface to the Google charting API: http://pygooglechart.slowchop.com/ --Ned. http://nedbatchelder.com Chris Haynes wrote: > I need to generate some line charts and bar graphs from django. I > recall seeing a very promissing package a couple months ago and can't >

Re: passing self?

2009-01-29 Thread Malcolm Tredinnick
On Thu, 2009-01-29 at 15:47 -0800, ajlozier wrote: > Hi Malcolm, > > I figured it out. This article is what pointed me in the right > direction: > > http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/ > > While you are right that there are a lot of examples in the code of > something

Re: charts in django

2009-01-29 Thread Tim Chase
Chris Haynes wrote: > I need to generate some line charts and bar graphs from django. I > recall seeing a very promissing package a couple months ago and can't > find it now. [snip] > Any other ideas or comments on the above? Linux Journal's most recent print-edition had a good article

Re: TINYMCE causing form error "This field is required."

2009-01-29 Thread Eric I.E.
Thanks for your help Daniel, That was exactly my problem. I changed the ModelForm in admin.py to this and it resolved the issue. class EntryAdminForm(forms.ModelForm): body_html = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30})) excerpt_html =

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

2009-01-29 Thread Malcolm Tredinnick
On Thu, 2009-01-29 at 18:47 +, Adam Stein wrote: > According to the docs, when using 'contains' in filter() a percent sign > or underscore is automatically escaped. However, in my case I want the > resulting SQL to use the percent sign. > > I know 'contains' will fill in the outside percent

Re: passing self?

2009-01-29 Thread ajlozier
Hope out loud is really all i was trying to do also - I'm not demanding a solution of you. And please believe me when i say i am very appreciative of your work on django personally. I actually love the framework and have been able to, rather quickly, throw together vast portions of my

Re: Django Forms in HTML 4.01 Strict

2009-01-29 Thread Malcolm Tredinnick
On Thu, 2009-01-29 at 15:18 +0100, Gertjan Klein wrote: > Malcolm Tredinnick wrote: > > >On Wed, 2009-01-28 at 14:33 +0100, Gertjan Klein wrote: > >> Malcolm Tredinnick wrote: > >> > >> I disagree. When I develop web pages (using Django or otherwise) I use > >> the Firefox HTML validator

Re: charts in django

2009-01-29 Thread Nick Lo
> I need to generate some line charts and bar graphs from django. I > recall seeing a very promissing package a couple months ago and can't > find it now. > > There's pychart, but it hasn't been maintained for a couple years and > I question its staying power, and it just generates images. open-

Unique_together across classes

2009-01-29 Thread CALdan
hi! I'm putting together a simple model in Django as an example for a large project. I'm attempting to set up the models in an efficient manner with as little redundancy as possible (none). What I'm attempting to do is use unique_together across 2 classes which are linked through their primary

Re: reason for missing readline() in uploaded files?

2009-01-29 Thread Todd O'Bryan
On Thu, Jan 29, 2009 at 9:28 PM, Malcolm Tredinnick wrote: > > On Thu, 2009-01-29 at 15:40 -0500, Todd O'Bryan wrote: >> I'm trying to validate an uploaded csv file, so I want to read the >> first line of text and if it's not the right format, send an error >> message.

Re: Unique_together across classes

2009-01-29 Thread Malcolm Tredinnick
On Thu, 2009-01-29 at 19:54 -0800, CALdan wrote: > hi! > > I'm putting together a simple model in Django as an example for a > large project. I'm attempting to set up the models in an efficient > manner with as little redundancy as possible (none). > > What I'm attempting to do is use

Re: Finding and Displaying the Object that a Comment is Created On

2009-01-29 Thread dave.mer...@gmail.com
Thanks SO much. That did the trick. Dave On Jan 29, 1:28 pm, "alex.gay...@gmail.com" wrote: > On Jan 29, 3:48 pm, "dave.mer...@gmail.com" > wrote: > > > This si a somewhat nooby question. > > > I have a comment. I want to display the post title

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

2009-01-29 Thread min
Hi. First, the code in the forms.py: class TestForm(forms.Form): name = forms.CharField( max_length=30 ) Then, the variable is defined in the views.py: def Test_page(request): form = TestForm() show_results = False variable = '' if request.GET.has_key('name'):

Re: building a blog site

2009-01-29 Thread jazz
Hi Muslu how can i can it yuor website to english. I dont uderstad that language. On Jan 19, 11:20 pm, "Muslu Yüksektepe" wrote: > i am preparing a blog site. > check outwww.yuksektepe.com > i will add how can make blog as soon as > thank you > from Turkiye > >

Re: error when using delete generic views

2009-01-29 Thread vierda
Dear all, Thanks for your reply I have modified my code as per below : views.py : def display_delete_profile(request): user = request.user if user.is_superuser: user_list = User.objects.all() return render_to_response ('delete.html', {'user_list':user_list}) def delete

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

2009-01-29 Thread Malcolm Tredinnick
On Thu, 2009-01-29 at 21:11 -0800, min wrote: > Hi. > > First, the code in the forms.py: > > class TestForm(forms.Form): > name = forms.CharField( max_length=30 ) > > Then, the variable is defined in the views.py: > > def Test_page(request): > form = TestForm() > show_results =

Re: error when using delete generic views

2009-01-29 Thread Malcolm Tredinnick
On Thu, 2009-01-29 at 21:31 -0800, vierda wrote: > Dear all, > Thanks for your reply I have modified my code as per below : > > views.py : [...] > def delete (request): >user = request.user >if user.is_superuser: > if request.method == 'POST': > form =

Validating and rendering dynamic form

2009-01-29 Thread DragonSlayre
I've created a dynamic form to allow users to upload images, and I'm trying to validate the form. - it displays fine, but when I validate and return a response, I get either a Key Error at the line (data = self.cleaned_data[dataName] ) in _clean_photo or I get a render error in my template at {{

Snippets app ?

2009-01-29 Thread Nicolas Steinmetz
Hi djangonauts, For my site, I planned to include a snippets app and was thinking about cab [1] which powers djangosnippets or some other snippets app. For Cab, it looks it's not updated since April 2007 so I think it's not compatible with Django 1.0.x or do not take benefit from 1.0.x

Re: charts in django

2009-01-29 Thread Jeff Hammerbacher
I've employed flot (http://code.google.com/p/flot/) with some success. It's pure javascript and requires jquery. On Thu, Jan 29, 2009 at 7:39 PM, Nick Lo wrote: > > > I need to generate some line charts and bar graphs from django. I > > recall seeing a very

Model for newbie

2009-01-29 Thread Kirill
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, how it's better to do model ?

Re: Performance using session, passing data from one request to another, use js or not? Best practice?

2009-01-29 Thread Thomas Guettler
Tim Daniel schrieb: > Thanks for the answer, I was already getting worried about my > 'session' way. No caching for know although it doesn't seem difficult > to implement. And yes the way you do it would have that advantage, but > mine has beautiful urls!! ^^ > thanks again, > > URLs are

Re: Model for newbie

2009-01-29 Thread DragonSlayre
I'm guessing that you might have tried to do a ForeignKey(User) for the other_invited. If that is the case, then I think you need to add a related_name e.g. ForeignKey(User, related_name="group_invited_to"). You may have to do a related name for the creator as well. I hope that helps. On Jan

odd cache behavior with memcached

2009-01-29 Thread levity
code sample: http://dpaste.com/114571/ that code runs on every request to a certain page, which is being hit frequently. there are only 10 unique keys, and each of them gets requested several times within the 5-minute window of cache expiration. however, what seems to happen is that things are