[Announce] Django Graphos - Django charting made *really* easy

2013-05-01 Thread Shabda Raaj
Hello, I would like to announce Django Graphos - An app which makes it really easy to work with Django graphs. https://github.com/agiliq/django-graphos Graphos is a Django app to plot data into graph. ### Supported Backends: * Python Nested lists * CSV Files * MongoDB * Django ORM ###

Using .extra after using .annotate is not working

2013-04-16 Thread Shabda Raaj
I am trying to get a field in a queryset which depends on the result of the annotations. I tried using extra on an annotated queryset, which doesn't seem to work. Lets say my models looks like this: class Foo(models.Model): name = models.CharField(...) class

Re: Editing the RSS in the Django community feeds

2013-03-13 Thread Shabda Raaj
Hi Guys, Updating feedburner actually pulled in a lot of old entries in the community feed. I am not sure why. My apologies for pushing this to the feed. Hopefully the feed will pick up only the new entries from now on. On Mar 12, 7:44 pm, Shabda Raaj <sha...@agiliq.com> wrote: >

Re: Editing the RSS in the Django community feeds

2013-03-12 Thread Shabda Raaj
Hi Russel, Thanks for your help. Looks like I was using this via feedburner, so I just updated it at the feedburner level. On Tuesday, March 12, 2013 7:57:46 AM UTC+5:30, Russell Keith-Magee wrote: > > Hi Shabda, > > I've got hold of the server logs - the feeds are tied i

Editing the RSS in the Django community feeds

2013-03-11 Thread Shabda Raaj
Hello, The Django community RSS feeds has a form to add new RSS: https://www.djangoproject.com/community/add/blogs/ We have our RSS added in this from way back. However sometime we write about non-django stuff, which is not relevant in this feed. I would like to update this to our Django only

[Announce]Django-parsley: Easy client side validations for Django

2013-03-07 Thread Shabda Raaj
I would like to announce our new app: Django Parsley - https://github.com/agiliq/django-parsley Django forms give you nice server side validations for free. This library adds client side valiadtions with very little effort to you your forms, using parsley.js. Patches and feedback welcome. --

Django Design Patterns and Djen of Django books on Kindle Store

2012-02-17 Thread Shabda Raaj
We have published our Ebooks on Kindle Store and would love to get some reviews. (Just $1 each) http://www.amazon.com/The-Djen-of-Django-ebook/dp/B006P1K0YY/ref=ntt_at_ep_dpt_2 http://www.amazon.com/Django-Design-Patterns-ebook/dp/B006OYO9SK/ref=ntt_at_ep_dpt_1 (They are also available for free

Re: Getting started with Django: New Udemy Class, free for a limited time

2012-02-02 Thread Shabda Raaj
. Various other tutorials. 5. Code samples of all code written in the screencasts and the tutorials. On Jan 28, 11:13 pm, Shabda Raaj <sha...@agiliq.com> wrote: > Here is the link:http://www.udemy.com/getting-started-with-django2/ > > More info: > I am starting aUdemyclass called

Getting started with Django: New Udemy Class, free for a limited time

2012-01-28 Thread Shabda Raaj
Here is the link: http://www.udemy.com/getting-started-with-django2/ More info: I am starting a Udemy class called "Getting started with Django". This is supposed to be a fast paced introduction to Django, and is going to be useful to people from beginner to intermediate Django skills. Please

Cross post from Djangoindia list: [Pycon] IRC Meeting to discuss how to represent Django

2009-08-10 Thread shabda
] sessions. Shabda will let us know the venue of the IRC meeting. In the meantime, let us decide on a suitable timing for the meeting. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Value proposition of Rails

2009-03-18 Thread shabda raaj
>Nobody ever releases accurate information on site information, so >anything you get here will be a guess. "Five biggest" is kind of a bad >number anyway, since your customer won't be any of them and it's >unlikely you're targeting them as your customers (if you're only looking >at the five

Re: Value proposition of Rails

2009-03-18 Thread shabda raaj
Ok, I am stupid! I was reading an article and mistyped! http://jooto.com/blog/index.php/2005/10/29/rails-value-proposition/ On Mar 19, 12:23 am, shabda <shabda.r...@gmail.com> wrote: > [Trying not be trollish, but the subject might be so. My apologies in > advance.] > > I

Value proposition of Rails

2009-03-18 Thread shabda
[Trying not be trollish, but the subject might be so. My apologies in advance.] I run a small Django development firm ( www.uswaretech.com ), and a lot of clients we go after need to be convinced on why they should choose Django. What is your experience in this? Specifically am I looking for is,

Writing a subclassable Django singleton model

2009-03-10 Thread shabda
In [6]: y=SubSingleton(name='a', tag='b') In [7]: y.save() --- AttributeErrorTraceback (most recent call last) /home/shabda/django_design_pats/ in () /home/shabda/django_design_pats/testf/models.pyc

Anyone maintaining a Svn repo for django-registration?

2008-12-16 Thread shabda
Django registration has moved from googlecode to Bitbucket, which means my projects which are svn:externaled to django-registration might not get the latest code. Is anyone maintaining an svn repository which is I can svn:external to? --~--~-~--~~~---~--~~ You

Is there a place from where I can get the completed code for the Django 4-part tutorial?

2008-11-17 Thread shabda
Is there a place where I can get the app completed as part of http://docs.djangoproject.com/en/dev/intro/tutorial04/#intro-tutorial04 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

How do test Middleware

2008-11-14 Thread shabda
I want to write some test for my middleware seperate from the views that would be using them. So I am using this snippet http://www.djangosnippets.org/snippets/963/ to get a request, and calling my middleware with it to test it, but it looks a little hackish to me. Is there a better way?

Filtering the modelform in Admin on request.user

2008-11-06 Thread shabda
I have an Admin site which I want to filter based on request.user. My ModelAdmin class is something like this, class FilterOnUser(admin.ModelAdmin): def queryset(self, request): return self.model._default_manager.filter(user = request.user) def get_form(self, request, obj=None,

Re: Why is my string not auto escaped?

2008-10-29 Thread shabda
So if these built in filters are marking my strings safe, inspite of unsafe data being passed in, should they not handle escaping as well? Rajesh Dhawan wrote: > On Oct 29, 8:35 am, shabda <[EMAIL PROTECTED]> wrote: > > I need to create a custom filter which displays so

Why is my string not auto escaped?

2008-10-29 Thread shabda
I need to create a custom filter which displays some data from db depending on its data type. My code is something like, from django.template.defaultfilters import linebreaks, urlize def filterxx(data) return linebreaks(urlize(data.value)) My data.value is Asdfghjkl alert('hole') This

How to get the Html representation of forms.Fields

2008-10-28 Thread shabda
I have some forms.Fields, which are not attached to any forms.Form. How can I get the Html representation of it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: trying to understand get_absolute_url, NoReverseMatch and url configs

2008-10-27 Thread shabda
You want something like this @models.permalink def get_absolute_url(self): return ('orgs.views.org', [self.type.slug, self.slug]) Essentially, you code would be doing something like reverse('/org/ hoa/', kwargs={..}) which fails. Templates supress Exceptions so you do not see them. On

Order of fields reset on Dynamically generated Forms.

2008-10-27 Thread shabda
I need to use DynamicForm(form generated using database values), so I am using this method, http://uswaretech.com/blog/2008/10/dynamic-forms-with-django/ Now the order in which I define the fields is not the same as that for the rendered Html. If I change the line like setattr(EmployeeForm,

Re: Feature like "acts_as" in Django ORM or contrib ?

2008-10-21 Thread shabda
Ordering: qs = Model.objects.filter(...).order_by('ordering_field') ord_list = [el for el in qs] Versioning: code.google.com/p/django-rcsfield (There are a few others, cant remember the names offhand.) On Oct 21, 12:13 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 21 oct, 08:37,

Re: Possible pug with Model inheritence - Inserts instead of Update

2008-10-12 Thread shabda
> so I would expect more problems > > On Oct 12, 9:16 am, shabda <[EMAIL PROTECTED]> wrote: > > > My models.py > > > class Foo(models.Model): > >     name = models.CharField(max_length = 100) > > >     def save(self): > >         self.i

How can I check which view is being called in response to a specific Url?

2008-10-12 Thread shabda
One of my views is returning a Http404, and I think it is calling a view function diffrent from what I am expecting to be called. So How can I check which view is being called in response to a specific Url? --~--~-~--~~~---~--~~ You received this message because

Possible pug with Model inheritence - Inserts instead of Update

2008-10-12 Thread shabda
]: shabda = Foo(name = 'Shabda') In [3]: shabda.save() In [4]: Foo.objects.all() Out[4]: [] In [5]: shabda.name = 'Shabda Raaj' In [6]: shabda.save() In [7]: Foo.objects.all() Out[7]: [, ] Which is what I expect. Now doing the same thing to Bar In [1]: from djcalendar.models import Bar

Arbitrary precision arithmetic in django

2008-07-09 Thread shabda
I need to do some Financial calculations in an app in Django. models.DecimalField is fixed precision, while I need an arbitrary precision field. How can I do this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Django test Client problems

2008-06-13 Thread shabda
I have some code like this, c = Client() client.get('/myurl/') where '//myurl' calls view function, def foo(request): ip_addrs = request.META['REMOTE_ADDR'] This view function works when I use a browser, as request.META['REMOTE_ADDR'] is populated. But when I use test Client, I get a

Re: Django Tutorial Clarification

2008-06-13 Thread shabda
> I have never used generic views, so share your confusion Well you really should. :) Well I have seen your name many times on the list so know that you are a longtime Django user. If you are not using generic views, you are missing something. On Jun 13, 12:41 pm, Kenneth Gonsalves <[EMAIL

Re: oracle-django problem

2008-06-09 Thread shabda
Or use this, >From http://www.djangoproject.com/documentation/model-api/#table-names "To override the database table name, use the db_table parameter in class Meta." On Jun 9, 7:46 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, Jun 9, 2008 at 6:43 AM, Harish <[EMAIL PROTECTED]> wrote: >

Trouble trying to use formtools.preview.FormPreview

2008-06-09 Thread shabda
I am trying to use formtools.preview.FormPreview after reading http://www.djangoproject.com/documentation/form_preview/ and am getting weird errors. This is what I did, 1. Have a form called AddReviewForm which is working as expected. 2. Created a class class ReviewPreviewForm(FormPreview):

Getting template errors before control goes to Django (Or so it seems)

2008-06-02 Thread shabda
I am trying to access an URL, and I get an error like this, Traceback (most recent call last): File "C:\Python25.1\lib\site-packages\django\core\servers \basehttp.py", line 277, in run self.result = application(self.environ, self.start_response) File

Django-India Google group

2008-05-30 Thread shabda
Hello All Django people based in India! Did you know that there was no django-india Google group? Ouch. So I have created the Django-India google group. [http:// groups.google.com/group/djangoindia]. If you are a django-developer based in India join this group, so we have a centraol place to

Installing GeoDjango help

2008-05-22 Thread shabda
Is there a simpler way to install GeoDjango, than the one mentioned at http://code.djangoproject.com/wiki/GeoDjangoInstall ? Also is there any documentation about GeoDjango apart form the one at the wiki? --~--~-~--~~~---~--~~ You received this message because

Announce: Djikiki - Django wiki application

2008-05-07 Thread shabda
Wanted to announce Djikiki - A Django based wiki to the community. Looks like there is no Django wiki, well apart from [1]. I had this done a few months ago, but I wanted to polish thing up a bit before I announced it here, but I guess right now I am going to be sorta busy for a long time with

[Repost] Error with .extra(tables=[]) after qs-rf

2008-04-30 Thread shabda
Reposting: Essentially my question is, what does "If that isn’t possible, put your extra() call at the front of the queryset construction so that your table is the first use of that table." mean? If I have overriden .get_query_set, to add a .extra, how can I move it too beginning of queryset

Re: Suggestions on UI (client side web) framework to complement Django

2008-04-30 Thread shabda
We used Dojo for our last project, but there was far too many things happening behind the scenes, and not really documented. We finally decided to rewrite evrything in Jquery. Now I never look farther than JQuery. :) Andre Meyer wrote: > On Tue, Apr 29, 2008 at 9:00 PM, Szaijan <[EMAIL

Re: Tutorial: __str__() problems

2008-04-29 Thread shabda
Though __str__ should work here, until you can get this working, try writing __unicode__ method [EMAIL PROTECTED] wrote: > Hello, > I'm just going through the mysite tutorial and can't seem to get the > __str__() method to work when adding it to the two classes, I still > get []. This happened

Re: Tutorial: __str__() problems

2008-04-29 Thread shabda
Though __str__ should work here, until you can get this working, try writing __unicode__ method [EMAIL PROTECTED] wrote: > Hello, > I'm just going through the mysite tutorial and can't seem to get the > __str__() method to work when adding it to the two classes, I still > get []. This happened

Regression with QS-RF

2008-04-29 Thread shabda
I have a queryset with .extra call where I do something like this, self.get_query_set().extra ... tables=['news_topic as permission_table'] .. Pre qs-rf, the values in tables were not being escaped and so this was working, with qs-rf the value in tables is escaped, so my code fails.

Re: Multi DB question

2008-04-17 Thread shabda
On Thu, Apr 17, 2008 at 6:00 AM, shabda <[EMAIL PROTECTED]> wrote: > > > I have a forum(non-Django) and a Django app both are in different > > databases. > > Can you install django on the forum database? It would probably make your > life a lot easier as you could w

Multi DB question

2008-04-17 Thread shabda
I have a forum(non-Django) and a Django app both are in different databases. When a user is created in the Django I want to create another User in Forum. Do I need to use MultiDB branch for this, or is there a simpler way? Maybe using python-MysqlDB directly? Is there a recent merge of Django and

Dynamic queryset to ModelChoiceField

2008-04-14 Thread shabda
I have a form where I want to do something like, class SetDefaultForm(forms.Form): topics = forms.ModelChoiceField() def __init__(self, user): super(SetDefaultForm, self).__init__() self.fields['topics'].queryset = Topic.objects.filter(user) This does not work, of

Re: I'd like to learn more about Django internals

2008-04-12 Thread shabda
I have been meaning to learn the code in django.db, but I can never get my head around metaclasses enough to do so. Anything you can suggest, Malcom? On Apr 12, 5:52 pm, "Erik Vorhes" <[EMAIL PROTECTED]> wrote: > You might be thinking of this >

Re: How we can integrate Django app in Google appengine.

2008-04-12 Thread shabda
[Shameless plug :)] http://www.42topics.com/dumps/django/docs.html http://www.42topics.com/dumps/appengine/doc.html On Apr 12, 4:49 pm, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > I'm not sure wether you're asking how to run django on GAE [1], or how > to do that using appengine's webapp

Re: Tree from the model.

2008-04-11 Thread shabda
Though I do not always use a reusable app, even if it exists, (leaky abstractions[1]), django-mptt is awesome. It does what it claims to do, and stays out of the way. Very recommended if you need to model hierarchical data. On Apr 11, 11:43 am, "James Bennett" <[EMAIL PROTECTED]> wrote: >

Re: Using Django with appengine - Port of the django tutorial for appengine

2008-04-10 Thread shabda
Oops, gave wrong link. The correct link is http://www.42topics.com/dumps/django/docs.html . That one I wrote yesterday for people who already know Django. On Apr 10, 11:35 pm, shabda <[EMAIL PROTECTED]> wrote: > I have tried to write a Django tutorial for Appengine. This can be > fo

Using Django with appengine - Port of the django tutorial for appengine

2008-04-10 Thread shabda
I have tried to write a Django tutorial for Appengine. This can be found here http://www.42topics.com/dumps/appengine/doc.html. This is a port of the django tutorial from http://www.djangoproject.com/documentation/tutorial01/ to use Appengine. A live install of this can be seen at

Anybody successfully deployed their Django app to Appengine?

2008-04-09 Thread shabda
Anybody successfully deployed their Django app to Appengine, and willing to share their code? I have a fair bit of code working on the dev_webserver, but it fails on deploying. Until the logging bug is resolved I think I am stuck behind seeing 500 server errors. I am sure I am missing something

Appengine, a few questions about imports

2008-04-09 Thread shabda
In Django's code I see from imp import find_module [1] However in google's runtime the app module is empty.[2] Can someone more experienced than me, tell when this code will be hit, and what can I do to not hit this code. [1]

Re: When does form.clean get called?

2008-04-09 Thread shabda
gt; wrote: > On Mon, 2008-04-07 at 07:29 -0700, shabda wrote: > > So is there a cleaner way to work in form.clean instead of doing > > if for.cleaned_datahas_key(field): > > for every element? > > It depends what you want to do in the clean() method. The example you >

Using Django with Appengine tutorial

2008-04-09 Thread shabda
Hi, I have written about how to build a Simple Django blog with appengine. You can find the tutorial here, http://www.42topics.com/dumps/appengine/doc.html. This documents what I learnt playing with appengine yesterday, and is very much a work in progress. This doc is released under

Anybody successfully deployed Django to appengine? Having some problems

2008-04-08 Thread shabda
I am trying to follow http://code.google.com/appengine/articles/django.html Which has a line # Log errors. django.dispatch.dispatcher.connect( log_exception, django.core.signals.got_request_exception) but log_exception is not defined/imported, so it gives a NameError. I guess they left the

Re: Anybody used Google app engine, and wanna share their experience?

2008-04-08 Thread shabda
eptance note around 10:15, but haven't had time to play around with > it yet. > > On Apr 7, 9:14 pm, shabda <[EMAIL PROTECTED]> wrote: > > > I got the news too late, and no more invites were avialable. Anyone > > who is using this, and their views ... --~--~-

cursor.execute throws exception on MySql warning

2008-04-07 Thread shabda
I have a call like, crsr = connection.cursor() crsr.execute('DROP TABLE IF EXISTS news_linksearch') when table news_linksearch does not exists this would lead to a mysql warning, (Not an error, as it has a IF EXISTS clause), but this leads to a django exception. Should not the behaviour in

Anybody used Google app engine, and wanna share their experience?

2008-04-07 Thread shabda
I got the news too late, and no more invites were avialable. Anyone who is using this, and their views ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: When does form.clean get called?

2008-04-07 Thread shabda
So is there a cleaner way to work in form.clean instead of doing if for.cleaned_datahas_key(field): for every element? On Apr 7, 6:06 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, Apr 7, 2008 at 8:19 AM, shabda <[EMAIL PROTECTED]> wrote: > > > I

When does form.clean get called?

2008-04-07 Thread shabda
If I have a required field and I do not specify a value for the field, should form.clean get called? My understanding, after reading http://www.djangoproject.com/documentation/newforms/#custom-form-and-field-validation, is that it should not, as clean_ will fail, and so form.clean will not be

Making login work with every page.

2008-04-06 Thread shabda
If a user is not logged in, then on each page, I have a login form. This form posts to /accounts/login/ which does calls contrib.auth.views.login. This view only logs in a user if the session.test_cookie_worked(). So this means that from each page I need to call, if not

Re: Weird unicode errors when using cutsom sql

2008-04-05 Thread shabda
Ouch, there was a % in the generated SQL. Guess I should have debugged a little more before posting here. :) On Apr 5, 1:44 pm, shabda <[EMAIL PROTECTED]> wrote: > I am using MYSql with latin-1 encoding. > > I get some weird intermittent errors when using custom sql. I

Transactions with custom sql

2008-04-04 Thread shabda
I am using mysql ith InooDB. I have some cutsom sql doing inserts. These inserts are not visible after the function returns, if I so something like sql = 'INSERT INTO tbl1 ...' from django.db import connection cursor = connection.cursor() cursor.execute(sql) return

How to pass location to profiler.hotshot?

2008-04-03 Thread shabda
By default profiler.hostshot[1] creates profiling info in "/var/log/ cmsprofile". I am on a shred hosting, and do not have access to this location. Is there any way I can specify the location without modifying this django file. Currently this values is hardcoded into this file as

Using CsrfMIddleware with ajax post requests

2008-04-02 Thread shabda
I have a some links, simple like .. . I handle clicks on them as ajax, and do a post . I want to protect this post against CSRF attacks, but CsrfMiddleware works only for form posts, because it add a form field. Is there some way I can get the CsrfMiddleware to work with ajax posts?

Optional else block in for

2008-03-31 Thread shabda
I was looking at jinja[1] and there was one feature which I really liked "for loops have an optional else block executed if there was no iteration." Right now most of my for loops are like, {% if comments %} {% for comment in comments %} {{comment}} {% endfor %} {% else %} There are no

Re: sports ratings

2008-03-29 Thread shabda
Read this, www.b-list.org/weblog/2007/sep/22/standalone-django-scripts/ , and create a standalone django script. Then set up a cron job to run your script when you want. On Mar 29, 11:53 pm, ameriblog <[EMAIL PROTECTED]> wrote: > i have my own formula used for sports ratings (like jeff sagarin,

Re: How are you storing binary data in db

2008-03-28 Thread shabda
Yes I was looking for snippets and recipes, not storing them in DB. There are some instances when storing things in DB is just too convinient comaring to storing them on files. For example I get some JSON from a external web service call. I want to cache it in the system, so I want to just pickle

Re: How to check the SQL that the Django ORM is executing?

2008-03-27 Thread shabda
wouldn't getting the queries from connection.queries be abetter approach? On Mar 28, 1:15 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > http://www.djangoproject.com/documentation/faq/#how-can-i-see-the-raw... > > or > > you can make a function like this: > > In [19]: def show_sql(query):

How are you storing binary data in db

2008-03-27 Thread shabda
Considering that BlobField is not supported, what are you using to store binary data. Recipes, snippets .. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Is identity map planned for Django ORM?

2008-03-27 Thread shabda
A test case showing the problem http://dpaste.com/41542/ . I always get bitten by this behaviour when I am writing tests. There was a discussion long ago about adding this feature of Identity maps

Re: Log a user in after registration?

2008-03-26 Thread shabda
You need to call authenticate() before you can call login() http://www.djangoproject.com/documentation/authentication/#how-to-log-a-user-in On Mar 26, 10:52 pm, truebosko <[EMAIL PROTECTED]> wrote: > I want to log a user in after they have registered on my site. > > Right now, I am using

Re: How to do background processing with Django

2008-03-26 Thread shabda
Not the end user but the people who would be downloading this application, and want to use this, in a shared hosting environment. On Mar 26, 7:39 pm, "Ian Lawrence" <[EMAIL PROTECTED]> wrote: > Hi > > > are django and apache. Adding a HTTP server or configuring django- > > queuing is too

Re: How to do background processing with Django

2008-03-26 Thread shabda
AIL PROTECTED]> wrote: > On Mar 26, 7:58 pm, shabda <[EMAIL PROTECTED]> wrote: > > > I response to some urls, my views need to start some potentially time > > taking actions. So how can I start background process, would it be as > > simple as > > > ... >

Re: How often do you update your django?

2008-03-26 Thread shabda
And if you are on windows, TortoiseSvn is a great way to get strated with svn. On Mar 26, 3:06 pm, James Tauber <[EMAIL PROTECTED]> wrote: > It might be worth adding that this approach works for Django because > development takes place on branches not the trunk. Other open source > projects may

How to do background processing with Django

2008-03-26 Thread shabda
I response to some urls, my views need to start some potentially time taking actions. So how can I start background process, would it be as simple as ... t = threading.Thread(...) t.setDaemon(True) t.start() return HttpResponse(..) Or does django/apache have limitation on how threading can be

Object paginator deprecated?

2008-03-26 Thread shabda
What are he new capbilities of the new paginator? Is there some wiki page tracking the deprications, like the backwardsincompatible changes? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Should not select related be default?

2008-03-24 Thread shabda
Ah, but practicality beats purity :) But of course I have not fully profiled, the times so might be not select_related as default is a good idea. On Mar 24, 5:40 pm, "Tom Badran" <[EMAIL PROTECTED]> wrote: > On Mon, Mar 24, 2008 at 11:03 AM, shabda <[EMAIL PROTECTED]> w

Should not select related be default?

2008-03-24 Thread shabda
In most of my pages, select_related dramatically reduces the number of queries the page is needing, so I was wondering what is the reason behind not making select_related default and providing a method for do_not_select_related --~--~-~--~~~---~--~~ You received

Re: Easy PDF generation using PISA HTML2PDF

2008-03-24 Thread shabda
I have used html2pdf in the past and it is awfully easy! In one of my apps, I had a requirement that each page be also available as pdf. so def view_func(self): ..normal processing if request.GET.has_key('pdf'): #Get the pdf template html =

Appending a variable to the query string for the current URL

2008-03-09 Thread shabda
On each of my pages I want to show a link, which outputs the current page in pdf. To do so I want to append ?pdf=1 or =1 to the current url. I do so using the code if request.META['QUERY_STRING']: pdfpath = '%s=1' % request.get_full_path() else: pdfpath = '%s?pdf=1'%

Re: How to get unclean data from newform?

2008-02-25 Thread shabda
Even after reading those two links I can not figure out the answer to my question. :( Brot wrote: > Hello, > > http://www.b-list.org/weblog/2007/nov/22/newforms/ > http://blog.michaeltrier.com/2007/11/23/getting-started-with-newforms > > Bernd > > On 26 Feb., 07:28,

How to get unclean data from newform?

2008-02-25 Thread shabda
I have a newform form. It has data bound to it. But it may be invalid. I want to get the data bound to each of its field. How can I do this? I can not use form.cleaned_data because that would work only when the form was valid. If I try for name, value in form.fields.iteritems(): print name,

Re: Django Filebrowser with FastCGI

2008-02-24 Thread shabda
I think, In a lot of old code, _ was automatically imported as ugettext, while the newer code explicitly imports it as from django.utils.translation import ugettext_lazy as _ Might be when you are running fastcgi, you are hitting some path where, _ is not imported, while under mod_python, you are

Re: File uploads with django - memory usage questions

2008-02-23 Thread shabda
. Or should this setting be specified somewhere in apache config? On Feb 24, 3:46 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > There is a ticket related to this:http://code.djangoproject.com/ticket/2070 > there is a patch that based on the comments should work. > >

File uploads with django - memory usage questions

2008-02-23 Thread shabda
I have a form which allows users to upload files. The form is, class AddFileForm(forms.Form): """Add a file.""" filename = forms.FileField() I am using S3 to store files, my view is something like, if request.method == 'POST': addfileform = bforms.AddFileForm(request.POST,

Re: django.test.client.Client returns HttpResponse/ How to make the test client follow 302 status codes?

2008-02-22 Thread shabda
Please ignore the previous message. I think I am too sleepy now, and am seeing things which do not exist. :) . On Feb 22, 11:57 pm, shabda <[EMAIL PROTECTED]> wrote: > Aww, I seems a call to c.get('/dashboard/') gets an object of type > HttpResponse while c.get('/dashboard/', {}) get

Re: django.test.client.Client returns HttpResponse/ How to make the test client follow 302 status codes?

2008-02-22 Thread shabda
Aww, I seems a call to c.get('/dashboard/') gets an object of type HttpResponse while c.get('/dashboard/', {}) gets a Response object. On Feb 22, 11:50 pm, shabda <[EMAIL PROTECTED]> wrote: > I have some test code written like, > > def testDashBoard(self): > c = Client

django.test.client.Client returns HttpResponse/ How to make the test client follow 302 status codes?

2008-02-22 Thread shabda
I have some test code written like, def testDashBoard(self): c = Client() print c.login(username = 'Shabda', password= 'shabda') response = c.get('/dashboard/') print response.headers['X-View'] This is giving me error

How to use pychecker with Django

2008-02-21 Thread shabda
I want to use pychecker to do static analysis on my code. So I set up DJAGO_SETTINGS_MODULE and run pychecker from shell. I am getting exceptions like, G:\prajact>pychecker project\urls.py G:\prajact>C:\Python24\python.exe C:\Python24\Lib\site-packages \pychecker\checker.py project\urls.py

Re: How to stop validations duplications in forms and models?

2008-02-21 Thread shabda
>(the save() method shouldn't raise >any validation errors except those triggered by the database server due >to IntegrityErrors). So what is the recommended place to write validations in models, for now? On Feb 22, 12:25 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-02-21 at

Re: Converting relational data to hiechical data

2008-02-21 Thread shabda
That would help once I get the relational data to a hierarchical list, and that is the difficult part! On Feb 21, 10:59 pm, Brian Luft <[EMAIL PROTECTED]> wrote: > http://www.djangoproject.com/documentation/templates/#unordered-list > > On Feb 21, 4:22 am, shabda <[EMAIL

Re: Evaluating/stepping through sliced QuerySets

2008-02-21 Thread shabda
There is a threaded comments app http://code.google.com/p/django-threadedcomments/ , Now that I think about it, they surely would be doing this conversion from relational to hierarchical format. I will read the code and let you know if I can find something useful. On Feb 20, 7:10 pm, Evert Rol

How to stop validations duplications in forms and models?

2008-02-21 Thread shabda
I have some models, and some forms to write data to them. The attributes in models need to have soem validations, (For example, name must be alpha numeric, price must be less that 1000 etc). SO I write the validations in model.save() and raise Exceptions, when a validation fails. I also need to

Converting relational data to hiechical data

2008-02-21 Thread shabda
I have a model like class Task(models.Model): name = Models.CharField(max_length = 100) parent = models.ForeignKey('Task', null = True) Using this model say I have got a table like, Task --- ID Name Parent_id 1 Foo null 2 Bar 1 3 Baz1 4 Bax2 I want to

How to use filefield, and specify custom, dynamic upload_to

2008-02-17 Thread shabda
I have a model like class File(models.Model): file = models.FileField(upload_to = 'files') project = models.ForeignKey(Project) class Project(models.Model): name = models.CharField(max_length = 100) I want to have each file go a specific directory corresponding to its project_name So I

Re: Setting request.GET when sending an HttpResponse

2008-02-14 Thread shabda
Umm, if you want to persist state across HTTP requests, why not use session? On Feb 14, 2:28 pm, mario <[EMAIL PROTECTED]> wrote: > Etienne, thanks for answering, > > > I believe you got this wrong a little. A HttpResponse object doesn't modify > > the query string. That should be done in your

Newfroms - How to get the id for a field

2008-02-14 Thread shabda
When using newforms, I want to get the id set on the input field. I am doing something like, {% for field in form %} {{ field }} ... Now this {{field}} will render as something like, Withing the template how can I access the value for id. If this is not possible where in code does Django set

Raising exception when a template objects is not present or raise s exception.

2008-02-12 Thread shabda
I want my template to raise exception, when an object is not preset or raises a exception. I am sure there is a setting for it, I just cant figure out where. Help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Creating password protected RSS feeds

2008-02-11 Thread shabda
This seems very useful! Is there some way I can wrap my rss feed within a view function? My feeds class looks like, class ProjectRss(Feed): def get_object(self, bits): I am using the django.contrib.syndication.feeds. Michael Elsdörfer wrote: > > How can I create passwords

Creating password protected RSS feeds

2008-02-11 Thread shabda
How can I create passwords protected feeds with Django? I guess I will have to go beyond the contrib.feeds framework, but if some one has any recipes/links to how to do this, it would be most helpful! --~--~-~--~~~---~--~~ You received this message because you are

  1   2   >