Hi,
I have a multi choice field to choose 1 or many months in checkboxes:
in forms.py:
months_open = forms.MultipleChoiceField(choices = MONTH_LIST,
widget=forms.CheckboxSelectMultiple)
then in my template I use {{ form.months_open }} to make the list
appear. Now that works but the list appears
I spotted this the other day: http://www.djangosnippets.org/snippets/334/
On Jun 15, 5:42 am, victor wrote:
> can django add custom permission without module association?
> if can,how to?
> thx a lot.
--~--~-~--~~~---~--~~
You received this message because you are
> It's a generic templating language, it's not particularly geared toward HTML.
> It's no HAML (you'll still get to write all the HTML yourself), but writing
> custom tags is much easier than with Django. Also, it compiles templates to
> Python code, which makes it reaaally fast.
fast is always g
On Jun 14, 11:43 pm, Olav wrote:
> On Jun 8, 5:37 pm, Necmettin Begiter
> wrote:> On Mon, Jun 8, 2009 at 16:39, Olav wrote:
> I also objects objects like articles, comments, posts are Django
shoud be: I also THINK
Anyway, what I mean is that if users, articles, blog comments etc are
not "known"
Hi
We are a small open source company situated in Copenhagen, Denmark. We
are working on a web portal for an organisation for volunteers working
with young people with problems related to loneliness etc.
The portal is based on Pinax, Django and MySQL.
We have established the portal on this test
After working through this I feel I need to follow through and
clarify what actually happened. As you say, Russ, there does not seem
to be any memory leak. However it is a lot fatter in it's memory
usage. I'm guessing this is due primarily to database caching. We will
be doing some capacity me
Hi,
I am Creating an application called 'Defect Tracking System'. My
models.py contain the three fields namely- Defect ID, Defect Status
and Defect Reported By.
I have to perform search operation based on these three fields.
ie if I specify the Defect ID it should give me the details of that
par
LD_LIBRARY_PATH variable is the correct one to use when running from
your account (not to go into the discussion as to why some people think
LD_LIBRARY_PATH is evil), as evidenced when you run python on the
command line.
In the case of Django running through a web server, the web server is
not pi
Hi,
with the django comments app how can I get all the comments form a
given user?
thanks,
Bastien
--~--~-~--~~~---~--~~
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
I was searching in the included template tags but obviously doing a
database search works very well:
Comment.objects.filter(user_name='myname')
thanks,
Bastien
On Jun 15, 3:09 pm, Bastien wrote:
> Hi,
>
> with the django comments app how can I get all the comments form a
> given user?
>
> than
Hi,
I have completed one web site and I am now ready to deploy it in
production, but I have serious issues where I can't find any
information/clue on the django web site, in the book or on IRC. I have
no idea how I can solve my problem
What I want to achieve is the following:
1 site under http w
Hi list,
I am trying to create a view to update objects in the db:
http://dpaste.com/55546/
but when posting the data, form.is_valid() fails because the object already
exists in the db. Is there a way to validate a form using an existing object
and then save it?
regards,
--
Genís
--~--~-
Hi all,
the question is in subject. Details:
I have a server running my Django project. I'd like to add support for
authorized AJAX-queries to my site. That is, user opens a page on the
http://some-3rd-party-site.tld If HTML of the page will contain a
published by me JavaScript AJAX-snippet then
Hi,
do you use the cache module? Be sure, that both projects use
different ones.
Maybe you need to set SESSION_COOKIE_NAME if the domain name is the
same.
Do you use one database or two? (Is settings.DATABASE_NAME the same?)
Thomas
Francis schrieb:
> Hi,
>
> I have completed one web site a
On Jun 15, 3:20 pm, Genis Pujol Hamelink
wrote:
> Hi list,
>
> I am trying to create a view to update objects in the db:
>
> http://dpaste.com/55546/
>
> but when posting the data, form.is_valid() fails because the object already
> exists in the db. Is there a way to validate a form using an exis
Hi guy's, im new with Python and Django, well im learning Python using
Django... im php user and CodeIgniter Framework, so i want to know
something about admin generator...
What i need to make a User Panel (user will write article, upload
pictures, etc) ? or the samen Admin Generator will help me
That seem likes to much overhead to make every request to go through.
Vitaly Babiy
On Mon, Jun 15, 2009 at 1:31 AM, Rama Vadakattu wrote:
>
> one simple idea ( it may or may not be feasible ) that you can use is
> 1) write down a middleware
> 2) examine the context which has a form and with the
Hi,
I try to deploy my web application written with django on Apache2 with
mod_python, but when I try to load my homepage using apache at
http://localhost/myproject/ my template does not load although the
TEMPLATE_DIR in django settings is correct, why?
My Apache2 http.conf file is correct beca
On Mon, Jun 15, 2009 at 11:01 AM, kiwi wrote:
>
> Hi,
>
> I try to deploy my web application written with django on Apache2 with
> mod_python, but when I try to load my homepage using apache at
> http://localhost/myproject/ my template does not load although the
> TEMPLATE_DIR in django settings
yes, but what if it's a new object and not an existing one? How do I test
this? The request method will be POST, so form will be form =
MyForm(request.POST)... so if form.pk exists in the db how do I tell it's
editing an existing object?
if request.method == 'POST':
form = myform(request.POST
Hi,
do you know about an existing application that would allow someone to
add (more-or-less) arbitrary forms to an object?
basically, I'm creating a conference management application, and when
you register for a conference different questions might be asked which
might not even be known today (e
On Mon, Jun 15, 2009 at 10:51 AM, Viktor wrote:
>
> Hi,
>
> do you know about an existing application that would allow someone to
> add (more-or-less) arbitrary forms to an object?
>
> basically, I'm creating a conference management application, and when
> you register for a conference different
I am creating a web app with Django. I use a local MySQL database to
store users etc, but also connect to a remote Oracle database to pull
in some information to display.
Due to Django's lack of multiple database support I have written my
own very smalI Oracle wrapper, using cx_Oracle. In an effo
On Jun 15, 6:18 pm, James Gregory wrote:
> I am creating a web app with Django. I use a local MySQL database to
> store users etc, but also connect to a remote Oracle database to pull
> in some information to display.
>
> Due to Django's lack of multiple database support I have written my
> own v
Hello,
I'm very new to Django and trying to configure apache to work
with the tutorial application. I installed mod_python and
configured httpd.conf to look like this:
# mod python
LoadModule python_module /usr/lib/apache2/modules/mod_python.so
NameVirtualHost *:80
ServerName django.tes
> Connections aren't thread safe - you have to ensure every thread gets
> its own connection. You can create a new connection every request or
> use a thread-local to cache connections.
>
Ok, thanks for the explanation/confirmation
James
--~--~-~--~~~---~--~~
You
Hi,
This a test conf with mod_python:
ServerName py.banshee.lnx
DocumentRoot "/home/www/python"
ErrorLog /var/log/apache2/cash-error_log
CustomLog /var/log/apache2/cash-out_log combined
SetHandler mod_python
PythonHandler django.core.handlers.modpython
Well I'm flummoxed. After reading your post I retested on my dev site, and
the problem has vanished. Then I tried on production and same thing, it's
gone!
I do have custom 404 and 500 templates. All I can figure that might have
changed is the file ownership - I'm using subversion and might have
On Mon, Jun 15, 2009 at 2:00 PM, Joseph Brown wrote:
> Well I'm flummoxed. After reading your post I retested on my dev site, and
> the problem has vanished. Then I tried on production and same thing, it's
> gone!
>
> I do have custom 404 and 500 templates. All I can figure that might have
> ch
Cache is planned for the non secure site, but not configured at this
point.
SESSION_COOKIE_NAME makes no diffrence.
When I log to https://mysite.com/myadmin
it redirect to http after succesful login, I need to manually enter
https.
Saving an entry generate a 502 BAD GATEWAY - The proxy server re
Also, if I set the SITE_ID to be equal in both config, When I save a
model entry, I got an error from django:
ERROR: canceling statement due to statement timeout
Francis
On Jun 15, 10:40 am, Thomas Guettler wrote:
> Hi,
>
> do you use the cache module? Be sure, that both projects use
> differe
On Jun 15, 11:11 am, Miles wrote:
> Connections aren't thread safe - you have to ensure every thread gets
> its own connection. You can create a new connection every request or
> use a thread-local to cache connections.
The latter is what Django does, although it's very easy to miss when
perusin
Hello,
I have been running a django site on apache using the following
alias...
WSGIScriptAlias /apps /path/to/django_application/apache/django.wsgi
In doing this I was pleasantly surprised to see that most of the URLs
worked fine. The only thing I needed to change was LOGIN_URL='/apps/
login'
What I want to do is get the date of the last update across
relationships to figure out when the last update in an entire series
of related objects happened.
I'm pasting the relevant code of my models below but for example, I
want to be able to call a series_updated method on project that
returns
I'm new to django and attempting to leverage the query functionality.
I'm not sure if what I'm attempting requires custom sql or if I"m just
missing something. I'm spending alot of time with the docs but
haven't found guidance for this issue.
Just using blogs as an easy example, assume the model
If I understand your question right there is an example that covers
this exact situation that may help at
http://docs.djangoproject.com/en/dev/topics/db/queries/#lookups-that-span-relationships
I believe it could come out to something like this:
e = Entry.objects.filter(title__exact='foo')
blo
Thanks for the info. I'll check it out.
On Jun 12, 11:06 am, Rajesh D wrote:
> On Jun 12, 9:29 am, LeeRisq wrote:
>
> > I am interested in changing the primary key of the User model to email
> > and also use that as the username.
>
> > I would like to maintain the admin interface as well.
>
> >
awesome. Thanks for that.
I put that in the comments in my code so if I ever get back to it
after an update I can streamline it a bit.
Thanks again.
On Jun 11, 10:44 am, Karen Tracey wrote:
> On Wed, Jun 10, 2009 at 3:24 PM, Streamweaver wrote:
>
>
>
>
>
> > Thanks so much for the reply.
>
>
Close. That returns all entrys that have title foo. I need all blogs
*where the last entry* has title foo. I think I need to
leverage .extra(where=something) but not having much luck.
On Jun 15, 2:36 pm, Streamweaver wrote:
> If I understand your question right there is an example that cover
A custom method in the model could work fine.
If you set a 'get_latest_by' in the Entry Model ->
http://www.djangoproject.com/documentation/models/get_latest/
Then in the Blog Model define something like:
def last_is_foo(self):
if Entry.objects.latest().title == 'foo'
return True
hi all... is it possible to do the following?
let's say the user types in the following url into their browser:
mysite.com/redirect/?http://www.newsiteout.com/whatever.asp
Is it possible to snag the redirect url after the ? in the url and
then use it to do a redirect? I've run into a situation
On Sun, Jun 14, 2009 at 14:45, Vitaly Babiy wrote:
> Hey Everyone,
> I need to change the inactive account error message on the
> AuthenticationForm, one thing I have is to replace the clean method on the
> form with my own custom clean method the problem with this is django test
> fail when I do
Yeah I think that is what I am going to do.
Thanks
Vitaly Babiy
On Mon, Jun 15, 2009 at 4:58 PM, TiNo wrote:
> On Sun, Jun 14, 2009 at 14:45, Vitaly Babiy wrote:
>
>> Hey Everyone,
>> I need to change the inactive account error message on the
>> AuthenticationForm, one thing I have is to repl
Hello,
I have just started experimenting with the Django user authentication
system, I am currently only running with the Python testserver (if
that matters). In my url.py file I have the following view mapping:
...
(r'^agent/$' , 'Sleipner.model.views.agent'),
.
This view looks like thi
On Mon, Jun 15, 2009 at 4:35 PM, Joakim Hove wrote:
>
> Hello,
>
> I have just started experimenting with the Django user authentication
> system, I am currently only running with the Python testserver (if
> that matters). In my url.py file I have the following view mapping:
>
> ...
> (r'^agent/$
Hi everyone,
I was creating some custom template tags and attempted to import my
models through the following import at the top of the file:
from ..models import *
Unfortunately this seems to be attempting to import from django.models
(which doesn't exist) rather than myapp.models and therefore
Hello,
thank you for answering.
> Did you log yourself in in the admin without thinking about it? That's
> usually how I end up logged in without realizing it.
I had thought of that - and did a fresh start of the browser without
any success. But, prompted by your suggestion I continued to remo
On Mon, Jun 15, 2009 at 4:39 PM, greatlemer wrote:
>
> Hi everyone,
>
> I was creating some custom template tags and attempted to import my
> models through the following import at the top of the file:
>
> from ..models import *
>
> Unfortunately this seems to be attempting to import from django.m
On Jun 15, 10:47 pm, Alex Gaynor wrote:
> On Mon, Jun 15, 2009 at 4:39 PM, greatlemer wrote:
>
>
>
>
>
> > Hi everyone,
>
> > I was creating some custom template tags and attempted to import my
> > models through the following import at the top of the file:
>
> > from ..models import *
>
> > Unfo
Hi
Newbie trying to preset a field on a form where the object is to be
inserted. The snippet below does not do it.
class FooForm(ModelForm):
class Meta:
model = Foo
if request.method == 'GET':
if foo_id > '0':
foo=Foo.objects.get(pk=foo_i
I've been running the python memcached connector for a while, without
much trouble. But just today during a stress test of one of the feeds
(read: many many requests expected), I've ran into an out of sockets
situation.
After every single request, the cache backend forces a disconnect from
all me
I'm just starting to use django and have run into a problem I have not
been able to solve.
I have a model Item which stores, among other things, user_id.
Then I have a ModelForm. I want user_id to be a hidden field. After
searching around the web, I found out how to create a hidden field.
The tem
I ran into what I think might be a bug and wanted to check here before
possibly posting it.
Essentially what seems to be happening is that Django seems to return
datetime.datetime or datetime.date from DateFields in models and I
can't figure out why it returns one type at one time and another typ
Hello,
I have been following along the Django tutorial, and as I was editing
the urlpatterns in my urls module, i got the following error
when I tried to run the mysite server:
AttributeError at /
'AdminSite' object has no attribute 'urls'
Request Method: GET
Request URL:
On Mon, Jun 15, 2009 at 10:34 PM, Streamweaver wrote:
>
> I ran into what I think might be a bug and wanted to check here before
> possibly posting it.
>
> Essentially what seems to be happening is that Django seems to return
> datetime.datetime or datetime.date from DateFields in models and I
> c
On Mon, Jun 15, 2009 at 8:34 PM, ebbnormal wrote:
>
> Hello,
>
> I have been following along the Django tutorial, and as I was editing
> the urlpatterns in my urls module, i got the following error
> when I tried to run the mysite server:
>
>AttributeError at /
>'AdminSite' object has no
sqlite3
I changed the method and it seems to be working now.
The code I'm using is:
def all_last_updated(self):
d = [self.last_updated, self.activity_set.latest
().last_updated]
d.sort()
d.reverse()
return d[0]
There seemed to be some problem when chaining sort(
else:
form = FooForm()
foo.date = request.session['date']# we
know request.session ['date'] has a value
form = FooForm(instance=foo)
...
You don't need this line==> foo=for
This can be done with javascript as follows :
1) View/middleware (depends on your needs) detects the redirection
url
2) put down the redirection url in the context and redirect to
template say abc.html
3) in abc.html
a) put the message "your are leaving our site"
b) write javascript
Hey everyone,
I'm writing a project that does some communication with proprietary devices
on a non-standard protocol, so I've written a custom exception class that
extends Exception and has some additional useful parameters. However, when I
raise an exception instantiated from my class, the pretty
On Jun 16, 3:34 am, Streamweaver wrote:
> sqlite3
>
> I changed the method and it seems to be working now.
>
> The code I'm using is:
>
> def all_last_updated(self):
> d = [self.last_updated, self.activity_set.latest
> ().last_updated]
> d.sort()
> d.reverse()
> re
On Jun 16, 1:12 am, k-dj wrote:
> I'm just starting to use django and have run into a problem I have not
> been able to solve.
>
> I have a model Item which stores, among other things, user_id.
> Then I have a ModelForm. I want user_id to be a hidden field. After
> searching around the web, I fou
On Jun 15, 4:23 pm, Genis Pujol Hamelink
wrote:
> yes, but what if it's a new object and not an existing one? How do I test
> this? The request method will be POST, so form will be form =
> MyForm(request.POST)... so if form.pk exists in the db how do I tell it's
> editing an existing object?
>
>
63 matches
Mail list logo