Dear Steve Holden,
Please consider the following block i wrote:
def process_request(self, request):
request.db_session = session()
request.db_session.time_stamp = str(datetime.datetime.now())
print 'process_request', request.db_session.time_stamp
def process_response(
it's ok how u get user into save function. There is also other way to it(if
u'll need something also in clean methods)
-in view function
form=WTForm()
form.user = user
if form.is_valid():
-in form
class WTForm(forms.Form):
user = none
and u can get use
Related Categories: Computers > Programming > Compilers (269)
Computers > Programming > Education (83) Computers > Programming >
Methodologies (630) ...
===
http://www.freewebs.com/olympicpen/
http://indianfriendfinder.com/go/g1036092-pmem
http://italia
On Fri, 2008-11-14 at 00:39 -0800, ershadul wrote:
> Dear Steve Holden,
> Please consider the following block i wrote:
>
> def process_request(self, request):
> request.db_session = session()
> request.db_session.time_stamp = str(datetime.datetime.now())
> print 'process_
DateField and Postgresql
Thanks
On Nov 13, 6:53 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> dbee wrote:
> > I'm having a simple issue here trying to pull dates out of a database.
> > I can only pull out double digit months eg. October, November,
> > December but not single ...
>
> > Database:
Hi,
I am trying to write cron job for trigger mail whenever task is
overdue.
Here is the code for simple sending mail.
import sys
import os
def setup_environment():
pathname = os.path.dirname(sys.argv[0])
sys.path.append(os.path.abspath(pathname))
sys.path.append(os.path.normpath(os
Has anyone got an example of a custom feed generator?
I am trying to create one and but I don't seem to be overriding the
correct methods:
class MediaRSS(Rss201rev2Feed):
def root_attibutes(self):
attrs = super(MediaRSS, self).root_attibutes()
attrs['xmlns:media'] = 'h
On Fri, 2008-11-14 at 02:52 -0800, laspal wrote:
> Hi,
> I am trying to write cron job for trigger mail whenever task is
> overdue.
[... snip ...]
> So my problem is how do I run it.I mean how can I connect to my djanog
> project??
> here is my project path -> /home/work/test/
> my settings.py
On Fri, 2008-11-14 at 02:55 -0800, timc3 wrote:
> Has anyone got an example of a custom feed generator?
>
> I am trying to create one and but I don't seem to be overriding the
> correct methods:
Or explaining what is going wrong. :-)
Care to give us a few clues as to the problems you're seeing
The following code would show the same content for all users:
{% cache 500 usertags %}
{% for tag in tags%}
{{ tag }}
{% endfor %}
{% endcache %}
I need to to be able to cache template content based on the user
session.
Does anyone know how to do that?
Thanks,
Sebastian
--~--~
Here i have customized the class in the templatetags folder and i have
render too. Using the function also i have called the parser function and
return the node object...
I have created the template also
How to call in the urls.py
Suggest me.
--~--~-~--~~~---~--~--
On Fri, 2008-11-14 at 03:24 -0800, Sebastian wrote:
> The following code would show the same content for all users:
>
> {% cache 500 usertags %}
>
> {% for tag in tags%}
> {{ tag }}
> {% endfor %}
>
> {% endcache %}
>
>
> I need to to be able to cache template content based on the user
> s
Hi,
I need to build a site that will mostly be a discussion board with
surveys. What Django apps would you recommend for this?
Thanks in advance,
Fernando
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django us
I've used xlrd. It's pretty straightforward and Excel 2007 is in the
works...
Here's the main Google Group for both projects:
http://groups.google.com/group/python-excel
Keyton
On Nov 13, 10:44 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> >> [my stuff about using XML templates with Excel]
> > No
> Or explaining what is going wrong. :-)
>
> Care to give us a few clues as to the problems you're seeing? On the
> surface, your class looks fairly much correct.
ha ha!! Yes of course this is the message that I am getting:
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
s
On Fri, 2008-11-14 at 04:22 -0800, timc3 wrote:
> > Or explaining what is going wrong. :-)
> >
> > Care to give us a few clues as to the problems you're seeing? On the
> > surface, your class looks fairly much correct.
>
> ha ha!! Yes of course this is the message that I am getting:
>
> File "/
On Fri, 2008-11-14 at 23:38 +1100, Malcolm Tredinnick wrote:
[...]
> Something with a get_object() method should be a subclass of
> django.contrib.syndication.feeds.Feed. That class has a feed_generator
> attribute which will be where your MediaRSS class goes.
Err ... feed_type, not feed_generat
hi.. friends,
I have one django site which is running on the internet...
Now the web service provider needs to monitor the django site and the
database.
Now they told me to create a webpage which goes through django and
fetch some data and
print in the webpage
the problem i am facing is, e
On Fri, 2008-11-14 at 16:59 +0530, suganthi saravanan wrote:
> Here i have customized the class in the templatetags folder and i have
> render too. Using the function also i have called the parser function
> and return the node object...
>
> I have created the template also
>
> How to call in th
Thanks for that! Has got me to at least display a feed:
class MediaRSS(Rss201rev2Feed):
def root_attibutes(self):
attrs = super(MediaRSS, self).root_attibutes()
attrs['xmlns:media'] = 'http://search.yahoo.com/mrss/'
return attrs
def add_root_elements(self
To answer my own question:
class MediaRSS(Rss201rev2Feed):
def root_attributes(self):
attrs = super(MediaRSS, self).root_attibutes()
attrs['xmlns:media'] = 'http://search.yahoo.com/mrss/'
return attrs
--~--~-~--~~~---~--~~
You received
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?
--~--~---
Hello,
I would like to incorporate an InlineModelAdmin to an existing model
with the django.tagging. How would I implement this functionality to
an existing model?
# models.py
from django.db import models
from tagging.fields import TagField
from tagging.models import Tag
class Post(models.Mod
Is the username/password prompt from Django or Apache Auth?
If it's Django, change the view to accept username/password params on
the query string (removing decorators and/or changing middleware to
allow access to that url). e.g.,
http://example.com/some/url/?username=foo&password=bar
If it's
hi. I have the following code in my forms.py
Anonymous = forms.ChoiceField (choices=Anonymous_Choices,
widget=forms.RadioSelect(attrs={'class':'anonymous'}))
which sets up a radio button UL on my form. This part is working
great. however, i've got a problem.
When viewing the source below:
Done. For those following along, here's the link:
http://www.djangosnippets.org/snippets/1186/
On Nov 13, 10:17 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On Fri, Nov 14, 2008 at 12:13 PM, Erik <[EMAIL PROTECTED]> wrote:
>
> > In case there are others following this topic, I have t
dbee wrote:
> DateField and Postgresql
>
> Thanks
>
> On Nov 13, 6:53 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
>> dbee wrote:
>>> I'm having a simple issue here trying to pull dates out of a database.
>>> I can only pull out double digit months eg. October, November,
>>> December but not sing
On 14 nov, 12:29, "suganthi saravanan" <[EMAIL PROTECTED]>
wrote:
> Here i have customized the class
???
> in the templatetags folder and i have
> render too.
???
> Using the function also i have called the parser function and
> return the node object...
>
> I have created the template also
this is not a django issue, but a browser issue.
you can solve it only with javascript.
either clear the browser history (so that there is no back)
or put something on the page(s) that checks for the auth cookie either
whenever the page is loaded/fronted or checks it periodically.
if the auth co
I'm using with Django 0.96 a custom Q object to make joins between
models, here's an example:
class Product(models.Model):
group = models.IntegerField() # primary key
code = models.CharField() # primary key
name = models.CharField()
...
class CartItem(models.Model):
product_g
btw ignore double underscores in featured list - typo
A
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from thi
Hey,
I ran into this when placing EPSG:4326 coded vector points onto a
Openlayers- Virtual Earth map setup. Due to the whole spherical
mercator issue I'm attempting to convert these points to 900913 format
but getting "Input geometry has unknown (-1) SRID" when running the
following view:
def
Using Django 1.0, devel server, on RHEL5, with python 2.4.
I have two apps, venues and content. A venues.Venue is linked to
content.Source via a ManyToManyField defined through VenueSource. When
I try to include VenueSource in the Admin form, the admin page for a
given Venue shows up fine, but
On Fri, Nov 14, 2008 at 11:28 AM, J. Cliff Dyer <[EMAIL PROTECTED]>wrote:
>
> Using Django 1.0, devel server, on RHEL5, with python 2.4.
>
> I have two apps, venues and content. A venues.Venue is linked to
> content.Source via a ManyToManyField defined through VenueSource. When
> I try to includ
I have a a family tree; as describd below
>>> son={'first':'Swami', 'last':'Vaidya'}
>>> family={'f':father, 's':son}
>>> family
{'s': {'last': 'Vaidya', 'first': 'Swami'}, 'f': {'last': 'Vaidya',
'first': 'Mahesh'}}
I would like to render this in template.; What I can think of is
{% for key in
Maybe this could help:
http://www.djangosnippets.org/snippets/1187/
--~--~-~--~~~---~--~~
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 unsubscri
On Fri, 2008-11-14 at 11:41 -0500, Karen Tracey wrote:
> On Fri, Nov 14, 2008 at 11:28 AM, J. Cliff Dyer <[EMAIL PROTECTED]>
> wrote:
>
> Using Django 1.0, devel server, on RHEL5, with python 2.4.
>
> I have two apps, venues and content. A venues.Venue is linked
mahesh_aka_amol wrote:
> I have a a family tree; as describd below
>
son={'first':'Swami', 'last':'Vaidya'}
family={'f':father, 's':son}
family
> {'s': {'last': 'Vaidya', 'first': 'Swami'}, 'f': {'last': 'Vaidya',
> 'first': 'Mahesh'}}
>
> I would like to render this in template.;
Hi Malcom,
So, I manged to pass in the language_code parameter successfully:
class CreditApplicationForm(forms.Form):
def __init__(self, language_code, *args, **kwargs):
self.language_code = language_code
super(CreditApplicationForm, self).__init__(*args, **kwargs)
The prob
> Quoting from the book of "if you hear hoofbeats, think horses, not
> zebras": This obviously isn't normal Django behaviour and since calling
> views is easily the most common operation in Django, it's safe to assume
> that any breakage here in Django would have been noticed by other
> people. Whi
I need to give permission to an admin user to add/edit a class, but
that class does not appear on the "available user permissions" list.
The class is listed automatically for superusers, so it appears to be
registered correctly with the admin. But I can't make that class
available to regular adm
That's exactly what I needed. I think I was looking at the old docs.
Thanks
On Nov 14, 3:34 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2008-11-14 at 03:24 -0800, Sebastian wrote:
> > The following code would show the same content for all users:
>
> > {% cache 500 usertags %}
>
>
Trying to mess with the styling of the polls view from the tutorial.
Where is it reading it's CSS from? Or where is it 'extending' its
style from. I tried to incorporate a CSS sheet from within that
directory and it wouldn't read it. It would only read HTML that I
placed in the document itself.
I think the problem was a combination of an incorrect template
directory and forgetting to touch dispatch.fcgi, in any case, it seems
to be working now.
Thanks for the help,
Jason
On Nov 13, 4:32 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Thu, 2008-11-13 at 11:12 -0800, sergioh wro
On Fri, 2008-11-14 at 11:41 -0500, Karen Tracey wrote:
> On Fri, Nov 14, 2008 at 11:28 AM, J. Cliff Dyer <[EMAIL PROTECTED]>
> wrote:
>
> Using Django 1.0, devel server, on RHEL5, with python 2.4.
>
> I have two apps, venues and content. A venues.Venue is linked
Hi,
I've create a model:
class ImagenesLugar(models.Model):
archivo = models.ImageField(upload_to="imageneslugar/")
texto = models.CharField(max_length=400)
The thing is that when i create a new instance of this model and
assign instance.archivo to a file then instance.archivo.path does
What you see is what you get when it comes to templates in the
Tutorial.
There is no default CSS or anything like that.
If you'd like to do CSS from a media file, you'll have to check the
docs on serving static files via the builtin server.
J
On Nov 14, 12:19 pm, prem1er <[EMAIL PROTECTED]> wr
I recently got a Django app (Satchmo e-commerce) working and turned my
attention to styling the site. I was immediately reminded of how much
I dislike HTML and CSS. Django templates have all the faults of HTML,
with another layer of complexity added.
I found a tool, clevercss, which seems to imp
On Nov 14, 9:31 pm, Javier <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've create a model:
>
> class ImagenesLugar(models.Model):
> archivo = models.ImageField(upload_to="imageneslugar/")
> texto = models.CharField(max_length=400)
>
> The thing is that when i create a new instance of this mode
On Fri, Nov 14, 2008 at 3:56 PM, ek_wals <[EMAIL PROTECTED]> wrote:
> It seems to me that this kind of thing is easily translated to Django
> templates,
> quicker to type, easier to read, and infinitely extendable.
>
> Any thoughts before I begin playing?
Feel free to write it. I wouldn't get any
Hi, I am trying to send mail from my website.
Here is my settings py:
EMAIL_HOST = 'mail.mydomain.ru'
EMAIL_HOST_USER = '[EMAIL PROTECTED]''
EMAIL_HOST_PASSWORD = 'pass'
EMAIL_PORT = 587
(credentials are correct, them work from PHP-script), telnet to smtp
server works fine.
But when I launch my sc
We have five or so ManyToMany fields (with 10,000+ and growing total
entires in each field, only a few are selected for any one profile) in
our user profile. When we bring up the profile in the admin, the page
takes a while to load and render and taxes django and the database
more than we
On Fri, Nov 14, 2008 at 5:49 PM, Eric Chamberlain <[EMAIL PROTECTED]> wrote:
> We have five or so ManyToMany fields (with 10,000+ and growing total
> entires in each field, only a few are selected for any one profile) in
> our user profile. When we bring up the profile in the admin, the page
> ta
I didn't have time to check your tarball but I have a guess...
Check the HTML source on the browser and look for any empty "src" for
images or "href" for stylesheets.
If you find any, this may be the culprit of the second request, as the
browser tries to load the same view when looking for the i
On Fri, 2008-11-14 at 06:25 -0800, Bobby Roberts wrote:
> hi. I have the following code in my forms.py
>
>
> Anonymous = forms.ChoiceField (choices=Anonymous_Choices,
> widget=forms.RadioSelect(attrs={'class':'anonymous'}))
>
>
> which sets up a radio button UL on my form. This part is work
On Fri, 2008-11-14 at 10:44 -0800, Brandon Taylor wrote:
> Hi Malcom,
>
> So, I manged to pass in the language_code parameter successfully:
>
> class CreditApplicationForm(forms.Form):
>
> def __init__(self, language_code, *args, **kwargs):
> self.language_code = language_code
>
If any Los Angeles area budding pony wranglers are interested, my
roommate and I are hosting a Django meetup at our place in Pasadena.
The meeting will start at 16 on Sunday, December 7 and we'll serve
dinner. We're going to continue working on a collaborative Django
project, so bring your porta
Hi buddies.
Can anyone tell me. How i use (no to make) the 'manytomany' relation
models?
The oficial doc don't dissolve my doubts.
Thanks.
Prinmode
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" grou
On Fri, 2008-11-14 at 13:58 -0500, Jeff Gentry wrote:
[...]
> I'm attaching a tarball, which immitates my setup in a minimal
> fashion. At least when running on my system, the following browser
> request triggers this behavior:
>
> http://servername/test/
>
> > rendering at all. You could try
On Fri, 2008-11-14 at 08:10 -0800, David Elias wrote:
> I'm using with Django 0.96 a custom Q object to make joins between
> models, here's an example:
>
> class Product(models.Model):
> group = models.IntegerField() # primary key
> code = models.CharField() # primary key
> name = mo
Alfonso,
You syntax looks correct.
The obvious first check is to make sure your model geometry field has
an srid specified such as:
geometry = models.MultiPolygonField(srid=4326)
and that your model has a geomanager:
objects = models.GeoManager()
If you don't specify an srid it *should* defa
I see. What I ended up doing was just subclassing the form for English
and Spanish and putting the logic in the view. It's not quite as
pretty as I'd like, but I'm out of time and need to get it going. I
would love to see an example of how to manipulate a form through the
__init__.
Thanks for you
Hi, I am new to Django (and python), and I have a question regarding
database query stuff
Basic info - I have a category model and an article model, and each
article is linked to a category through a foreign key
If i have the following code
---
category = Category.objects.all()[0]
return Http
hello,
i noticed that if i put {%block%} tag inside {%if%} tag in my
template, the contents of the block gets rendered even when the {%if%}
test fails. is this a bug?
thanks
konstantin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to t
On Fri, 2008-11-14 at 20:26 -0800, kaos wrote:
[...]
> Will that return the count of all of the articles in the given
> category using a COUNT(*) query, or will it actually pull ALL of the
> articles from the database and get the size of the array?
>
> Basically i'm trying to figure out if im be
On Fri, 2008-11-14 at 20:45 -0800, akonsu wrote:
> hello,
>
> i noticed that if i put {%block%} tag inside {%if%} tag in my
> template, the contents of the block gets rendered even when the {%if%}
> test fails. is this a bug?
It sounds like a bug in the way you've written your template. Because
Malcolm, thanks for the response.
here is the relevant part of my template in a simplified form:
{% if my_list %}
{% block head-extra %}
{{ block.super }}
{% endblock %}
{% endif %}
if my_list is empty, it still renders the element. this one
does not:
{% block head-extra %}
{{ block.su
Can anyone point to me a reference to setup mod_python on Apache virtual
host for Django? Or write something about it?
I am able to run my app in Django development server. I am also able to set
up virtual host to display index.html for my website. Now I am ready to move
my Django app to productio
On Fri, 2008-11-14 at 21:11 -0800, akonsu wrote:
> Malcolm, thanks for the response.
>
> here is the relevant part of my template in a simplified form:
>
> {% if my_list %}
> {% block head-extra %}
> {{ block.super }}
>
thanks
ive been reading the documentation constantly, i just couldnt seem to
find that particular tidbit ;]
loving django
On Nov 15, 5:50 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2008-11-14 at 20:26 -0800, kaos wrote:
>
> [...]
>
> > Will that return the count of all of the a
Malcolm Tredinnick wrote:
[...]
> (5) Checked the HTML that was returned by curl (that was why I used "-i"
> and not just "-I"), since it's now clear that the returned HTML contains
> the problem and noticed the error on the second attempt.
>
> You're using the deprecated "background" attribute o
Tonight we've released Django 1.0.1, a bugfix release in the 1.0
series containing improvements and fixes since the 1.0 release. This
is a recommended upgrade for anyone currently running Django 1.0.
The blog entry announcing the release is here:
http://www.djangoproject.com/weblog/2008/nov/15/10
I set up Django on windows recently, but I assume you need help with
setting it up in linux? (which i know very little of)
Since you've been using the django development server I assume you
know about basic setup (using 'setup.py install', 'django-admin.py
startproject myproject' and 'manage.py s
On Nov 14, 2008, at 4:00 PM, James Bennett wrote:
>
> On Fri, Nov 14, 2008 at 5:49 PM, Eric Chamberlain <[EMAIL PROTECTED]> wrote:
>> We have five or so ManyToMany fields (with 10,000+ and growing total
>> entires in each field, only a few are selected for any one profile)
>> in
>> our user pr
Ok I got the point but I run into some other problem.
when I run python /home/laspal/test/test.py It run without giving any
error.
but when I do crontab -e and add the file
-> */5 * * * * /home/laspal/work/ibms/triget_mail.py > /tmp/foo.log
2>&1
and go to /tmp/foo.log I am getting error
/home
Try telling crontab to execute your script with python ;)
Or put #!/usr/bin/env python on the first line and chmod appropriately
-cheers
matt
On Sat, Nov 15, 2008 at 12:41 AM, laspal <[EMAIL PROTECTED]> wrote:
>
> Ok I got the point but I run into some other problem.
>
> when I run python /home/
76 matches
Mail list logo