My Django form looks like this:
---
Type:
{{ form.syslist }}
Name:
{{ form.name }}
---
My JS copy droplist value to text field code looks like this:
---
books
movies
restaurants
---
I'm strugglin
On Sat, Mar 14, 2009 at 5:21 AM, Chris wrote:
>
> I'm trying to test an email sending feature, and the email text
> requires the current domain, which I'm getting from request.META
> ['HTTP_HOST']. On a normal system, this works fine, but when I access
> it using the test framework and django.tes
I want to take a table like People with entires id, Name, Sex and send
it to HTML to do something like this:
{% for name in people.filter(sex='M') %}
Male: {{ People.Name }}
{% end %}
But, it's too late to do this in HTML. So, I'm trying to create an
array of pre-sorted lists in views.py to sen
On Fri, Mar 13, 2009 at 2:53 PM, joemanfoo wrote:
>
> Hi there,
>
> I'm very new to both Python and Django, so please pardon my ignorance
>
>
> Here's what I'd like to do...
> I've two models, one foriegnKey'ed to the other.
>
> in models.py:
> class Market(models.model):
>name = models.CharF
On Sat, Mar 14, 2009 at 3:11 AM, msoulier wrote:
>
> Hi,
>
> Django 0.96 (yes, I know, we'll be at 1.0.2. soon), and I have a model
> full of PositiveIntegerField attributes.
>
> One of them is returning a string.
>
metrics.user_licenses_ca
> '315'
type(metrics.user_licenses_ca)
>
It'
On Fri, 2009-03-13 at 21:27 -0700, Flank wrote:
> in order to use django/conf/urls/defaults.py, handler404, i did 2
> things:
> 1:change DEBUG = False in settings.py
> 2:create a 404.html template in the root of the template directory
>
>
> when i request a page that won't find ,such as
> http:
On Fri, 2009-03-13 at 21:08 -0700, ihome wrote:
> Hi,
>
> I am using the latest django development version and have some problem
> with the render_to_response to render a template. Here is a short
> snippet:
>
> return render_to_response('index.html', {
> 'form': form,
> 'ops
in order to use django/conf/urls/defaults.py, handler404, i did 2
things:
1:change DEBUG = False in settings.py
2:create a 404.html template in the root of the template directory
when i request a page that won't find ,such as
http://localhost/page_don_exist.html.a
http 500 error is reported,
b
On Mar 14, 12:08 am, ihome wrote:
> Hi,
>
> I am using the latest django development version and have some problem
> with the render_to_response to render a template. Here is a short
> snippet:
>
> return render_to_response('index.html', {
> 'form': form,
> 'ops' : ops,
>
Hi,
I am using the latest django development version and have some problem
with the render_to_response to render a template. Here is a short
snippet:
return render_to_response('index.html', {
'form': form,
'ops' : ops,
})
form comes from a newly defined data form inher
Have you tried:
python C:\path\to\django\bin\django-admin.py help
>From my limited experience it sounds like windows is just running the
python interpreter with no arguments when you try to execute it like
that. Perhaps windows cannot actually correctly immitate the shabang
functionality.
On Ma
On Fri, 2009-03-13 at 19:29 -0700, Sergio wrote:
>
>
> On Mar 14, 2:23 am, Malcolm Tredinnick
> wrote:
> > Character fields in Django can never be NULL. They will either be empty
> > (and stored as '') or not empty, but never stored as NULL in the
> > database.
>
> thanks for your answer. Coul
On Mar 14, 2:23 am, Malcolm Tredinnick
wrote:
> Character fields in Django can never be NULL. They will either be empty
> (and stored as '') or not empty, but never stored as NULL in the
> database.
thanks for your answer. Could you please give more insight on this
note?
"When using the Oracl
On Fri, 2009-03-13 at 16:51 -0700, Sergio wrote:
> Hello,
>
> reading from this page:
> http://docs.djangoproject.com/en/dev/ref/models/fields/#null
>
> I understand that, at validation time, I could use (variable is not
> None) to verify whether the user did enter characters or not.
>
> Consid
On Fri, 2009-03-13 at 13:22 -0700, sieg...@gmail.com wrote:
> Hello!
>
> If I'm using the transaction middleware in a management command and
> there is a conflict (e.g. transaction A in process a writes something,
> and transaction B in process b overwrites it) does django detect that
> and if ye
Hello,
reading from this page:
http://docs.djangoproject.com/en/dev/ref/models/fields/#null
I understand that, at validation time, I could use (variable is not
None) to verify whether the user did enter characters or not.
Considering the note, it seems that, in case of oracle DB, I should
use (
I have four Python applications running in production and never had
any major issues before. Now, I would like to try Django but I'm
struggling with the very first step, the install / setup. Your help
will be much appreciated.
I'm running Python 2.6.1 and installed Django1.0.2 Final on my Windows
Hello!
If I'm using the transaction middleware in a management command and
there is a conflict (e.g. transaction A in process a writes something,
and transaction B in process b overwrites it) does django detect that
and if yes what does it do?
i.e. does it throw an exception in save()?
or throw
Hi,
I just wrote a helper app to import contacts from Google.
http://github.com/amitu/dgci/tree/master
Anybody willing to help me write a similar dyci for Yahoo!? :-)
--
Amit Upadhyay
Vakow! www.vakow.com
+91-9820-295-512
--~--~-~--~~~---~--~~
You received this
On Fri, 2009-03-13 at 15:39 -0400, Blake M. Sisco wrote:
> Here's my problem. I have set up a django app for my company to make
> it easier for our warranty manager to track warranties. It's working
> great (it's the first thing I've done w/ django and I love it) with
> one exception. I have a
On Fri, 2009-03-13 at 12:02 -0700, Adam Nelson wrote:
> If I have a QuerySet like this:
>
> >>> o1 = Store.objects.all()
> >>> for o2 in o1:
> ...o2.employees.all()
> ...
> [, ...]
>
>
> Is there any way to get all employees for all stores without having to
> do the for (in other words some
Hello all,
I am trying to create a ModelForm subclass to customize the admin
interface for one of my models. In particular, I am attempting to add
a field to the ModelForm dynamically in its __init__ method (per
advice found here: http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/).
I would
Hello,
I successfully set up django-registration on my local machine to the
point of being able to load a url and attempt to load the template.
However, I'm trying to set it up on Dreamhost and keep getting "An
unhandled exception was thrown by the application." The only thing I
had to do differe
You were missing to give the definition of Foo. I assume, that you are
using ModelForm http://docs.djangoproject.com/en/dev/topics/forms/modelforms/
to create FooForm, right?
> model = Foo()
> form = FooForm(instance=model)
If you did so, you can just skip the instance and replace this l
Ick, stupid mistake, as i thought. Thanks for the help!
On Mar 13, 1:58 pm, Alex Gaynor wrote:
> On Fri, Mar 13, 2009 at 1:44 PM, Robocop wrote:
>
> > Hello Again,
>
> > Now i don't believe this to be a django-ccentric problem, but because
> > i'm running this as a django project, i thought i
I'm getting this error:
AttributeError: 'NoneType' object has no attribute 'append'
It's coming from this line in my template:
{% scores_for_objects share_list as score_dict %}
If I remove this line everything is fine. I wasn't getting this error
before but I had to wipe my server and create a
I have a model Foo and a corresponding FooForm with the requisite
inner Meta class and model=Foo. I want a url example.com/newfoo to
bring up a blank form to allow the creation of a new Foo instance. It
is not obvious to me how this should be done. I reckon it is
something very roughly like:
On Mar 13, 3:12 pm, joemanfoo wrote:
> I've gotten things to work for me, using the same tutorial, but I've
> always used the absolute path to my project in the PythonPath
> portion...try changing your PythonPath setting to:
>
> PythonPath "['F:/django'] + sys.path"
>
> HTHs
>
> On Mar 13, 2:11
Uhm maybe this post will help its a tag that handles the
pagination on query objects. I've used it in a few of my projects and
its quite handy.
http://blog.awarelabs.com/?p=29
-Paul
On Mar 13, 12:13 pm, Jesse wrote:
> Hello Micah,
>
> I can get the q with GET, but I have too complicated o
On Fri, Mar 13, 2009 at 1:44 PM, Robocop wrote:
>
> Hello Again,
>
> Now i don't believe this to be a django-ccentric problem, but because
> i'm running this as a django project, i thought i'd cover all my bases
> and post here. I have a page i'm doing a simple webmaster contact
> form on, and i
Actually, I thought of a way to adapt my code as a general-purpose
solution... you could bundle it up as a separate app basically consisting of
a middleware, the processing script, the lock file and the tasks directory,
plus some useful functions in the __init__.py file. Other apps could write
the
It's not putting anything into the session. The session is basically a
jazzed-up dictionary, and the get method works pretty much just like it does
with the dictionary, it will try and get the objected pointed to by the key
(the first argument) but if that doesn't work, it returns the default (the
I'm trying to test an email sending feature, and the email text
requires the current domain, which I'm getting from request.META
['HTTP_HOST']. On a normal system, this works fine, but when I access
it using the test framework and django.test.Client, I get a KeyError
exception for 'HTTP_HOST'.
I
> I think I kinda understand the way it works now. I can see that I
> require a mysite.fcgi. How does that file look like? It is not written
> in the docs
You could try
http://cleverdevil.org/computing/24/python-fastcgi-wsgi-and-lighttpd
although I've had more luck with
http://iamtgc.com/2007/07
Thank you very much James, I couldn't get a better answer. I will try
this right away and hopefully get back on the right path!
On Mar 13, 8:29 pm, James Bennett wrote:
> On Fri, Mar 13, 2009 at 5:02 AM, Bastien wrote:
> > I will answer my own question since I found the answer, may be it can
>
Looking at the django-cart open source code:
cart = request.session.get('cart', None) or Cart()
Does the new cart object that recently got created be put back into
request.session['cart'].
I was thinking of improving the code located in
http://code.google.com/p/django-cart/source/browse/trunk/d
What is happening here:
fav_color = request.session.get('fav_color', 'red')
Is it trying to retrieve 'fav_color' from the session. If it doesn't
exist, does it put it in the session and assign the value 'red' for
it.
--~--~-~--~~~---~--~~
You received this mess
Here's my problem. I have set up a django app for my company to make it
easier for our warranty manager to track warranties. It's working great
(it's the first thing I've done w/ django and I love it) with one
exception. I have a boolean field (recieved_vendor) in my warranty model
that, when ch
I know I've seen this before, so I'm hoping someone can help me find
it again.
I need to dynamically filter a select box in the admin, preferably
with jquery (just because I already have it there and it's available)
What I have is a car makes and models with a many to many
relationship. (Some ca
On Fri, Mar 13, 2009 at 5:02 AM, Bastien wrote:
> I will answer my own question since I found the answer, may be it can
> help someone:
Unfortunately you found the wrong answer; if you're making changes to
the code that came with django-registration, you're doin' it wrong.
The "register" view t
Hello Micah,
I can get the q with GET, but I have too complicated of a search and I
need to use POST. I'm having much difficulty with my template code
with POST to work with paginator. I'll keep trying. Thanks for your
patience and help.
--~--~-~--~~~---~--~~
I've gotten things to work for me, using the same tutorial, but I've
always used the absolute path to my project in the PythonPath
portion...try changing your PythonPath setting to:
PythonPath "['F:/django'] + sys.path"
HTHs
On Mar 13, 2:11 pm, waltbrad wrote:
> I'm trying to get this setup on
If I have a QuerySet like this:
>>> o1 = Store.objects.all()
>>> for o2 in o1:
...o2.employees.all()
...
[, ...]
Is there any way to get all employees for all stores without having to
do the for (in other words some sort of one line solution)? I seem to
need to do this frequently and it se
Hi there,
I'm very new to both Python and Django, so please pardon my ignorance
Here's what I'd like to do...
I've two models, one foriegnKey'ed to the other.
in models.py:
class Market(models.model):
name = models.CharField(max_length=55)
class Alias(models.model):
market_id = models
Thank you so much. I've just started the tutorials on their website
and from what I've seen so far I like it a lot.
On Mar 13, 12:40 pm, Rajesh D wrote:
> On Mar 13, 9:51 am, Kier wrote:
>
> > I'm new to django so forgive me if this is a noobish question. I'm
> > creating a website where users
Hello Again,
Now i don't believe this to be a django-ccentric problem, but because
i'm running this as a django project, i thought i'd cover all my bases
and post here. I have a page i'm doing a simple webmaster contact
form on, and i'm doing it the same way i have on other sites:
Hey all,
We're looking for some django developers to help us out this summer
with some apps (production oriented databases) at a visual effects /
animation studio in New York city. The ideal candidates would be
local students looking for challenging real world experience. Python
knowledge is a
have this
fieldsets=[
(None,{'fields': ['plc_sys']}),
('TS',{'fields': ['context']}),
]
want to filter foreign key context like this
.exclude(pk__in=VoipGateway.objects.values_list('name',flat=True))
Is there a way to add this to the definition
--~--~-~--~~---
Hi,
Django 0.96 (yes, I know, we'll be at 1.0.2. soon), and I have a model
full of PositiveIntegerField attributes.
One of them is returning a string.
>>> metrics.user_licenses_ca
'315'
>>> type(metrics.user_licenses_ca)
PostgreSQL backend
I thought that the PositiveIntegerField would enforc
I'm trying to get this setup on my computer to simulate what I will
have online in preparation for any problems that might be encountered.
I've got apache2 and mod_python working together, I was able to get
the basic Hello World and a form/response on it, so I know that's
working. I've had Djang
Hello, I have been looking for Django-based forum-building software,
and so far, the two best candidates are Snap and SCT. Does anyone have
any experience with either, and willing to comment on them? Or are
there other apps that might be better than those? Thanks.
John C>
--~--~-~--~
On Fri, Mar 13, 2009 at 12:04 PM, Alex G wrote:
> I knew it was going to be something like this. I'm sorry to have
> troubled you :-/.
No worries at all. `super()` confuses the hell out of me, too :)
Jacob
--~--~-~--~~~---~--~~
You received this message because
On Mar 13, 9:51 am, Kier wrote:
> I'm new to django so forgive me if this is a noobish question. I'm
> creating a website where users can log in and create projects. I would
> like to keep up with which user created which project and allow him to
> easily get a list of projects he created. Also
On Mar 12, 3:11 pm, simong wrote:
> I'm creating a profile form that includes first_name and last_name
> fields that write to the User model and additional fields that write
> to my user profile model derived from Alex S's post
> here:http://groups.google.com/group/django-users/msg/00e49ca16c
/sigh
I knew it was going to be something like this. I'm sorry to have
troubled you :-/.
Thank you, JKM.
On Mar 12, 9:31 pm, Jacob Kaplan-Moss
wrote:
> On Wed, Mar 11, 2009 at 11:30 AM,Alex G wrote:
>
> > Having referencedhttp://www.b-list.org/weblog/2008/nov/09/dynamic-forms/,
> > I set abou
Especially since international phone numbers can start with 0--try
storing that in an integer field, and you'll immediately run into
problems.
On Mar 13, 8:43 am, Ozan Onay wrote:
> As Karen pointed out, you should consider a phone number to be a
> string, not an integer. Integers are there to d
Hey Bayo --
To expand a bit on what Alex said, the relevant bit of the
documentation is
http://docs.djangoproject.com/en/dev/internals/contributing/#patch-style.
In essence, what you'll do is:
- Make an SVN checkout of Django.
- Make whatever doc edits you want to submit in the `docs/` directory
On Fri, Mar 13, 2009 at 11:08 AM, bayo opadeyi wrote:
>
> Please can somebody point me to info on submission of documentation
> patches?
>
> --
> Bayo
> Qrapht Software Dev. Co.
> http://boyombo.blogspot.com
>
> "Perfection, then, is finally achieved, not when there is nothing left
> to add, but w
Please can somebody point me to info on submission of documentation patches?
--
Bayo
Qrapht Software Dev. Co.
http://boyombo.blogspot.com
"Perfection, then, is finally achieved, not when there is nothing left
to add, but when there is nothing left to take away"
- Antoine de Saint Exupery
--~-
Hello,
I have been thinking about a problem a bit, found a pretty nice
solution and would like to know, what others think of it and if there
are downsides I have forgotten about.
Starting point is a form, that has dynamically generated parts. In my
example, I generate a form from a model via Mod
And no, I'm not using any plugins, except of course have DEBUG=True.
On Mar 12, 10:59 pm, Karen Tracey wrote:
> On Thu, Mar 12, 2009 at 11:24 PM, adrian wrote:
>
> > I have a view that does not evaluate a queryset, it just adds filters
> > and order_by and then
> > passes it to Paginator (set t
I read the reference and understand the concept of trying to limit
huge queries, but
don't understand repr() or what's going on in this instance. My
query already has a limit on it, but even if
it was a bigger query, it is still intentional.
I have only one query set, and it is not iterated or
On Mar 14, 1:18 am, "Leonel Nunez" wrote:
> > Dear all,
>
> > I'm still new with django. I have just started django with FCGI as such:
> > python manage.py runfcgi method=prefork host=127.0.0.1 port=8801
>
> > But when I access my application from the browser :http://localhost:8801
> > Nothing
On Fri, Mar 13, 2009 at 7:31 AM, Ravi Kumar wrote:
> I need an architecture in a project using Django and Python + MySQL, so
> that when I put a python script in specified directory, that should be
> loaded and its methods/functions can be used.
> As far as i have thought on this, I am going to s
> Dear all,
>
> I'm still new with django. I have just started django with FCGI as such:
> python manage.py runfcgi method=prefork host=127.0.0.1 port=8801
>
> But when I access my application from the browser : http://localhost:8801
> Nothing happens, the browser just hangs without showing anythi
Here is what I came up with. I had to override ModelForm as well to
get rid of validation errors in emptied forms. This solution works in
my use case where I only have CharFields and IntegerFields. It's not
as simple as I had wished. Can it be?
class DeleteIfEmptyModelForm(ModelForm):
"""
I'm new to django so forgive me if this is a noobish question. I'm
creating a website where users can log in and create projects. I would
like to keep up with which user created which project and allow him to
easily get a list of projects he created. Also I want a user to only
be able to edit a pr
Thanks!!
I´ll take a look ... It´s look nice ;)
2009/3/12 Jacob Kaplan-Moss
>
> On Tue, Mar 10, 2009 at 12:20 PM, Flank wrote:
> > where can i get open source blog on django for GAE?
>
> App Engine is new enough you'll probably have better luck writing one
> yourself. Here's a place to start:
Dear all,
I'm still new with django. I have just started django with FCGI as such:
python manage.py runfcgi method=prefork host=127.0.0.1 port=8801
But when I access my application from the browser : http://localhost:8801
Nothing happens, the browser just hangs without showing anything.
I've re
I did think of another way to do this, though it still doesn't seem
like the most elegant solution to me. I can give users permission to
change/delete model A, but then "hide" the links on the admin index
page. Obviously this doesn't prevent an astute user from simply
entering the url, so it's by
As Karen pointed out, you should consider a phone number to be a
string, not an integer. Integers are there to do mathematical
operations on, which I can't imagine you requiring for a phone number
(what's the relevance of my phone no. + 5?). Also anything that you
would want to do with a phone num
I need an architecture in a project using Django and Python + MySQL, so that
when I put a python script in specified directory, that should be loaded and
its methods/functions can be used.
As far as i have thought on this, I am going to scan that particular
directory, list out the files, import th
Hi there,
I think what you've figured out is something along the same lines that
I'd like to do - but I'm very new to both Python and Django, so please
pardon my ignorance in that I really didn't understand the solution
you two spoke about.
Here's what I'd like to do...
I've two models, one for
Hello ...
I realy don´t know what happening, but, i´ve deleted my models and the
tables in database, redo all the model and this workds now...
There´s my old code...
*class enquete(models.Model):
pergunta = models.CharField('Pergunta', max_length = 50)
habilitada = models.BooleanField('Habil
Dearest Django persons,
I've finally taken an app of mine, tidied it up a little, and GPLv3-
published it.
It does 3 simple things to enable you to use email / password for
authentication with django.contrib.auth instead of username /
password.
- an Authentication backend
- a login Form that ta
That's correct, it has to be the name of the profile model as written
in app/models.py.
s/
On Mar 11, 5:25 am, Micah Ransdell wrote:
> Viktor,
>
> Try capitalizing UserProfile so that it is 'membership.UserProfile' instead
> of all lowercase. That has worked for me in the past.
>
> Micah
>
> On
I will answer my own question since I found the answer, may be it can
help someone:
in the views add this line:
from registration.forms import RegistrationFormTermsOfService
and then in the register function change form_class from
RegistrationForm to RegistrationFormTermsOfService
in the templa
On Thu, 2009-03-12 at 18:57 -0700, adrian wrote:
>
> I have users with 30K rows in the database and have to support various
> types of queries, some of which
> require raw SQL. I used a two-step approach to get the query_set,
> first do a raw SQL query to get a list of the ids of the rows I nee
Hi,
this does not answer your question, but some weeks ago I
used py2exe and wix to create a msi. I have not used windows
for years and py2exe and wix were new for me. But it took only some ours
to get it working.
HTH,
Thomas
cjl schrieb:
> I am in the process of updating my little django pr
79 matches
Mail list logo