Re: JavaScript function call

2009-12-29 Thread Kevin Renskers
First of all, in your template include jQuery: http://ajax.googleapis.com/ajax/ libs/jquery/1.3/jquery.min.js"> Create a new javascript file, and put the following code in it: // This is automatically run when the document has been completely loaded $(function() { // Find all tr's in your

Re: How to test activation email on windows?

2009-12-29 Thread Jonathan Nelson
I'm using Gmail to manage as my email provider: http://www.mangoorange.com/2008/09/15/sending-email-via-gmail-in-django/ It works with Google apps for your domain, too. So you can use my_n...@my_domain.com if my_domain.com is set up with Google apps. Best, J On Dec 27, 12:50 am, vishy wrote: >

Re: How to deal with NULL value in template

2009-12-29 Thread lei sun
Maybe you just store "Null",which is a simple string, in your sql.Storing None to replace. 2009/12/19 Continuation > I tried > > {% if field %} > No > {% else %} > Yes - {{ field }} > {% endif %} > > And if the value of field is null, the else statement above ended up > getting executed and o

querysets with multiple filtering

2009-12-29 Thread GoSantoni
Hi group, Does anybody have a suggestion for this problem? I am trying to make a matchmodel between the same field in two lists, item_one and item_two. Item is one of the Charfields in a Post. The Post is attached with a foreign key to a blog (blog__id=1 or blog__id=2). So if in item list one the

ajax filtered fields - can not get it run

2009-12-29 Thread kirian
hy! i would be interested in some help for my topic that i posted at stackoverflow. since i think that it is difficult to post me some help i want to generate some more attention to my post. i think in this google group a lot of people are here which do know ajax filtered fields (http://code.googl

sorl.thumbnail on apache2

2009-12-29 Thread Osiaq
INDEX.HTML: error message: 'thumbnail' is not a valid tag library: Could not load template library from django.templatetags.thumbnail, cannot import name defaults 1 {% extends 'website/base_website.html' %} 2 {% load thumbnail %} <--PROBLEM HERE on development server using 'python man

Re: How to deal with NULL value in template

2009-12-29 Thread Daniel Roseman
On Dec 18, 9:43 pm, Continuation wrote: > I tried > > {% if field %} >    No > {% else %} >   Yes - {{ field }} > {% endif %} > > And if the value of field is null, the else statement above ended up > getting executed and output was "Yes - None" > > So far for me: > > {% ifequal field Null %} and

Re: reverse drops the project from the url returned

2009-12-29 Thread davathar
I'm using mod_wsgi. which contains this to point to settings: os.environ['DJANGO_SETTINGS_MODULE'] = 'helpdesk.settings' application = WSGIHandler() My settings.py has: # ROOT_URLCONF = 'helpdesk.urls' # INSTALLED_APPS = ( # 'helpdesk.support', # ) If I manually key in example.com/helpdesk/s

Re: Problem importing datetime from xml

2009-12-29 Thread bax...@gretschpages.com
I probably shouldn't have posted this so close to Christmas. I'm hoping someone will see it now and be able to help. On Dec 21, 10:57 am, "bax...@gretschpages.com" wrote: > I'm importing data from xml using xmltramp. Among the data are a bunch > of times formatted like so: > >       2010-05-15 00

Reg. creating dynamic db table

2009-12-29 Thread Saravanan
Here I have an issue, Idon't know how to proceed. Here what I have in models.py I have a base class: for example say class base_class(models.Model) In this base class I have definition for a db table, class Meta: abstract = True I have an manager class : class manager_class(models.Manager) In this

Re: Problem importing datetime from xml

2009-12-29 Thread Daniel Roseman
On Dec 29, 9:03 pm, "bax...@gretschpages.com" wrote: > I probably shouldn't have posted this so close to Christmas. I'm > hoping someone will see it now and be able to help. > > On Dec 21, 10:57 am, "bax...@gretschpages.com" > wrote: > > > I'm importing data from xml using xmltramp. Among the dat

Reg. creating dynamic db table

2009-12-29 Thread Saravanan
Here I have an issue, I don't know how to proceed. Here what I have in models.py I have a base class: for example say class base_class(models.Model) In this base class I have definition for a db table, class Meta: abstract = True I have an manager class : class manager_class(models.Manager) In this

don't understand why isinstance returns false

2009-12-29 Thread neridaj
def moderate_comment(sender, **kwargs): instance = kwargs['instance'] if not instance.id: content = instance.content_object if isinstance(content, Tweet): delta = datetime.datetime.now() - content.pub_time delta = datetime.date

Re: don't understand why isinstance returns false

2009-12-29 Thread neridaj
fixed. On Dec 29, 1:38 pm, neridaj wrote: > def moderate_comment(sender, **kwargs): >         instance = kwargs['instance'] >         if not instance.id: >             content = instance.content_object >             if isinstance(content, Tweet): >                     delta = datetime.datetime.no

populate fields

2009-12-29 Thread shaner
new to django, i'm looking for some documentation on how i can populate one model with data from another one is there a dry method for that? i've seen the examples for populating user or slug but i'd just like to go from one model to another for example a support ticket model, and an office model,

Re: announcement: SHPAML (alternative to haml)

2009-12-29 Thread Durbin
very cool! any plans to integrate it fully into the django templating system? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to djan

Switching from soc2009/multidb to trunk; cross db foreign keys

2009-12-29 Thread CB
Hello. I've been developing on the multdb branch for awhile now (most recent version just before the dropping of the 'using' meta attribute), and everything has been going well. Recently though, with multidb landing in the trunk, I wanted to switch over to the trunk. I have a 'partitioning' schem

Re: Problem importing datetime from xml

2009-12-29 Thread bax...@gretschpages.com
On Dec 29, 3:04 pm, Daniel Roseman wrote: > I think you're going to need to show us some of the actual code. Thanks Daniel. I figured it out. In some instances stop time didn't exist, so of course it wouldn't validate as a datetime. Adding a check to set empty stop times to the start time fixed

local variable 'delta' referenced before assignment

2009-12-29 Thread neridaj
I don't see why this error is happening, the var is assigned. def moderate_comment(sender, **kwargs): instance = kwargs['instance'] if not instance.id: content = instance.content_object if isinstance(content, Tweet): delta = datetime.datetime

Re: local variable 'delta' referenced before assignment

2009-12-29 Thread Chris Withers
neridaj wrote: > I don't see why this error is happening, the var is assigned. > > def moderate_comment(sender, **kwargs): > instance = kwargs['instance'] > if not instance.id: > content = instance.content_object > if isinstance(content, Tweet): > de

Re: local variable 'delta' referenced before assignment

2009-12-29 Thread neridaj
Traceback: File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ site-packages/django/core/handlers/base.py" in get_response 92. response = callback(request, *callback_args, **callback_kwargs) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/

Re: {% url admin:index %} generating wrong urls

2009-12-29 Thread Chris Withers
Karen Tracey wrote: > There is at least one bug open on empty PATH_INFO handling: > > http://code.djangoproject.com/ticket/9435 > > though it doesn't sound like it's focused on exactly the same issue, No, I had as thorough a look as I could and could find no issue which directly covered this i

Re: local variable 'delta' referenced before assignment

2009-12-29 Thread Chris Withers
neridaj wrote: > File "/Users/jasonnerida/django-apps/blog/models.py" in > moderate_comment > 142. if delta.days > 30: Okay, now the line numbered code for the whole of the moderate_comment function... Also, check you're not mixing tabs and spaces in that models.py file... Chris --

Re: local variable 'delta' referenced before assignment

2009-12-29 Thread Ramiro Morales
On Tue, Dec 29, 2009 at 8:31 PM, neridaj wrote: > File "/Users/jasonnerida/django-apps/blog/models.py" in > moderate_comment >  142.         if delta.days > 30: I suspect you have the above line badly indented, e.g. at the same level of the if not instance.id: line because it appears to

Re: local variable 'delta' referenced before assignment

2009-12-29 Thread neridaj
I guess I was mixing tabs and spaces, thanks guys. On Dec 29, 3:38 pm, Ramiro Morales wrote: > On Tue, Dec 29, 2009 at 8:31 PM, neridaj wrote: > > File "/Users/jasonnerida/django-apps/blog/models.py" in > > moderate_comment > >  142.         if delta.days > 30: > > I suspect you have the above l

Custom template tag for a chaptered document?

2009-12-29 Thread Stodge
I need to write a custom tag. I have a hierarchy of objects that I want to turn into a chaptered document. But I want to be able to build and display the document in a template AND generate a PDF or other format from a view. Can I write a custom template tag and use it in a template and from a view

Anonymous Visitors vs. Registered User Preference Juggling

2009-12-29 Thread Koobz
Hi Folks, This is my problem: I want a notion of preferences for anonymous users and registered users. Preferences can be things like "saved searches", "favorite restaurant", or a personalized portal configuration for the home page. The immediate solution is to store a pickled preference object

Subject line in django-contact-form

2009-12-29 Thread shacker
The docs and code for ubernostrum's django-contact-form imply that the app includes a Subject field by default. But putting {{form}} in contact_form.html only gives you name, email address, and message fields. It's not clear to me those fields are showing up but the Subject field is not. Is subclas

Re: Subject line in django-contact-form

2009-12-29 Thread Rolando Espinoza La Fuente
On Tue, Dec 29, 2009 at 9:40 PM, shacker wrote: > The docs and code for ubernostrum's django-contact-form imply that the > app includes a Subject field by default. But putting {{form}} in > contact_form.html only gives you name, email address, and message > fields. It's not clear to me those field

Re: Subject line in django-contact-form

2009-12-29 Thread shacker
On Dec 29, 6:03 pm, Rolando Espinoza La Fuente wrote: > > The "subject" is not intended to be filled with user input through the web > form. Hmm, I find that odd. It's standard practice to let the user enter the subject for a contact form. I wouldn't want my inbox filled with contacts from site

Re: Subject line in django-contact-form

2009-12-29 Thread Rolando Espinoza La Fuente
On Tue, Dec 29, 2009 at 10:24 PM, shacker wrote: [...] > > Yes, I have the default/basics working just fine. Just not sure I > understand why the docs and source code seem to imply that a subject > field will be there but then it doesn't show up as part of the > {{form}} dict. I'm trying to under

Re: Subject line in django-contact-form

2009-12-29 Thread James Bennett
On Tue, Dec 29, 2009 at 8:24 PM, shacker wrote: > Hmm, I find that odd.  It's standard practice to let the user enter > the subject for a contact form. I wouldn't want my inbox filled with > contacts from site users, all with the same subject line. In my experience, it's far more common for all m

Re: Subject line in django-contact-form

2009-12-29 Thread shacker
On Dec 29, 6:42 pm, James Bennett wrote: > > If this really bothers you, it's trivial to set up your own > contact-form class which collects a subject line as well. Trivial depending on your level of experience :) For benefit of others, here's how I solved it: 1) In my own forms definitions, ad

Creating a ISP control panel with Django.

2009-12-29 Thread Marc Aymerich
Hi everyone, I just started developing my first web application, I chose Django for this job and I'm so excited with it. It's a control panel with billing system for the ISP which I'm working for. This control panel allows customers and our admins to add domains, email accounts, ftp accounts, data

Re: Reg. creating dynamic db table

2009-12-29 Thread Waqqas Jabbar
You can make one table and have date-time field in it corresponding to the time when the row is inserted. Then you can give a query to get for a day, days, month, or a year. On Wed, Dec 30, 2009 at 2:08 AM, Saravanan wrote: > Here I have an issue, I don't know how to proceed. > Here what I have i

Re: Creating a ISP control panel with Django.

2009-12-29 Thread Waqqas Jabbar
The main idea in django is to reuse apps. Define the functionality that you want and search for it. It is likely that you will find a lot of applications that you can use to speed up ur development. As an example of using a lot of application, check out http://pinaxproject.com/ On Wed, Dec 30, 2

Business logic versus rendering code and how it affects OO code organization

2009-12-29 Thread Margie Roginski
Is it considered preferable to use tags to render html, versus using an object method? For example, in the admin app I see that the following tag is used like so: {% result_list cl %} cl is an object, and I'm wondering what is the advantage of creating result_list as a tag, rather than just usi

Project optimisation stage: Advice to boost speed of database queries across tables?

2009-12-29 Thread Sam Walters
Hi I have reached the optimisation stage of my project. I am trying to work out how to reduce the turnaround time for my queries. I implemented 'db_index=True' for the fields where i determined there should be a performance boost by indexing that particular field. This has not really improved the