TypeError at /order/add/ Exception Value: 'type'
> object is unsubscriptable
>
> Any help is appreciated.
I am absolutely amazed that you don't get a syntax error on that statement.
regards
Steve
--~--~-~--~~~---~--~~
You received th
Knut Nesheim wrote:
> 27 sep 2008 kl. 11.58 skrev Steve Holden:
>
>
>> Knut Nesheim wrote:
>>
>>> Hi!
>>>
>>> We're trying to build a multi-page form using FormWizard. We need to
>>> authorize the user first. In other views we
()
return HttpResponseRedirect("/")
else:
if request.user.is_superuser:
form = formclass(instance=d)
return render_to_response('domain_form.html', {"form": form},
context_inst
Steve Holden wrote:
> Paddy Joy wrote:
>
>> I have a model with a 'User' foreign key.
>>
>> class Domain(models.Model):
>> .
>> owner = models.ForeignKey(User)
>>
>> I have a requirement to only allow superuers to change
Paddy Joy wrote:
> Thanks for the tip I didn't know you could define the formclass like
> that. Definately makes it more readable.
>
>
Yes, classes are first-class objects in Python, so you can pass them as
function arguments, save them in variables, and so on
ally expanded.
>
> Thomas
>
>
I'm sorry to day that even your fix still misses out a minute of the
range you want. It's an unfortunate side-effect of defining a date as
its beginning midnight.
The range generated should really be
BE
nical staff often don't
get to make much input into what are ostensibly technical decisions.
Don't be too downhearted if they end up choosing Liferay: at least you
have done your best to knock some sense into them.
regards
Steve
--~--~-~--~~~---~--~~
You re
y. Is there a "right" way to do this?
Thanks,
Steve Bergman
--~--~-~--~~~---~--~~
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
Thank you. That looks to be exactly what I need. I remember seeing
that on the ToDo list leading up to 1.0, but didn't realize how it
applied to my situation.
-Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google G
can often turn out
to be a maze of twisty little passages, all alike. It's difficult (for
me, anyway - maybe there's some obvious technique I have overlooked) to
trace which pieces of code and which URLs are associated.
regards
Steve
--~--~-~--~~~---~--
t many
time the contortions people go through to make the admin interface do
what they want actually end up taking more time than writing the
necessary customized views.
Sorry if this isn't helpful, but I have seen many cases where people ask
"how do I make the admin interface do (somet
You could also think about actioning a pre- or post-save signal if that
would allow you to access the pieces you need.
regards
Steve
AndyH wrote:
> OK... thinking about this, I guess add() on a ManyToManyField is just
> a wrapper around the save() method of the model your saving it on t
scover(), which scans
the various apps for an admin model. You could do something similar for
your search functionality. It's doing pretty much what you already do,
though.
regards
Steve
--~--~-~--~~~---~--~~
You received this message because you are
Malcolm Tredinnick wrote:
> On Fri, 2008-10-03 at 13:29 -0400, Steve Holden wrote:
>
>> Alexis Bellido wrote:
>>
>>> Cool, thanks for the confirmation. I'm still devouring all the
>>> documentation, a couple of books and practicing a lot on Django
; in full_clean
> 224. value = field.clean(value)
> File "/Users/matthew/sandbox/cc-django-1.0-integration/lib/django/
> forms/fields.py" in clean
> 648. if not self.valid_value(value):
> File "/Users/matthew/sandbox/cc-django-1.0-integra
c.date_based',
>> url(r'^blog/(?P)\d{4}/$', 'archive_year', entry_info_dict,
>> name='archive_year'),
>> )
>>
>>
That pattern should be
r'^blog/(?P\d{4})/$
As it is you are passing the null string as your "
ame thing with books on holdenweb.com (though in fact this is
done in a context manager, not in the view itself, since it is common to
all pages).
Is your problem the mechanics of *making* the random choice, or are you
uncertain how to get it into your
hat Django's specific import methods will be able to cope with
things that would be syntactically illegal in the import statement.
I suspect the real problem is the dot in the name: Django will be
looking fpr a package, 0, with a submodule called 1.
regards
Steve
--
Steve Holden
Bobby Roberts wrote:
>> Is your problem the mechanics of *making* the random choice, or are you
>> uncertain how to get it into your output?
>>
>
> Hi Steve -
>
> Yeah i know the randomization needs to be in the view and then pushed
> back to the template.
cently pointed out he hadn't yet
had time to 1.0-ify all his contributions. The only change i had to make
was changing
import newforms as forms
to
import forms
regards
Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goog
orloop.counter|divisibleby:"3" %}{% endif %}
> {{ letter }}
> {% if forloop.counter|divisibleby:"3" %}{% endif %}
> {% endfor %}
>
>
Better still, see
http://www.djangosnippets.org/snippets/401/
which may well have solved this problem for you in a tidil
n you anything other than
the scoop on using Django with Apache.
regards
Steve
--~--~-~--~~~---~--~~
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@google
are on the right track. Essentially your models
need to be complex enough to describe all possible events that your
users might want to create. This should avoid the need to restart the
database, but you may well find that you need several different tables
(in much the same way your database uses
is before?
>
I suspect each site should be a separate project: this would avoid the
app directory name being inserted at the top level as it is now. With a
separate settings file for each site you can then use the sites
subsystem the way it was intended if you want to share content.
regar
o_response('player_form.html', {'form': form})
>
> But I've this error:
>
> ValueError: The view mysite.views.setup_player didn't return an
> HttpResponse object.
>
> why??
>
Because you have no action when request.method != "POST", and so
make Python think it's found Django at the
top level. If you delete or rename $HOME/projects/__init__.py you should
then be able to find core.
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
--~--~-~--~--
This is another incompatible change: older versions used "maxlength".
Have you examined
http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges
This is there to help with situation like yours.
regards
Steve
David wrote:
> Thank you Karen.
>
> I've gotten
applications for other people to run on their servers,
your users don't get access to the Python source anyway. You already
knew that, right?
regards
Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
&quo
[EMAIL PROTECTED] wrote:
> Hi steve.
> I know if i have only the .pyc files i don't see the source.
>
> But then, if upload to the server only the .pyc and my application
> work correctly, then this solve my problem.
>
> Exists programs which convert .py files in .pyc
First, make it work. Then worry about security. Once you have a working
site the rest will be easy.
regards
Steve
[EMAIL PROTECTED] wrote:
> In this situation, pass the .pyc files to .py is hard?
> Because all i want to do is dificulty to see my source code, or never
> see my sourc
Ovnicraft wrote:
>
>
> 2008/10/15 [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
>
>
> Hi steve.
> I know if i have only the .pyc files i don't see the source.
>
> But then, if
Yes, I understand. But the best way to protect yourself is to deal with
trustworthy clients under a sensible license agreement.
If I don't trust a client not to steal my code they don't stay a client ...
regards
Steve
[EMAIL PROTECTED] wrote:
> Steve.
> I have test the
Because that won't matter to his boss ;-)
regards
Steve
Graham Dumpleton wrote:
>
> On Oct 16, 3:41 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>> I agree with you, but I am an officer and my boss likes of things
>> well, then, I am try
eate(product=product,sort=sort,picture=file)
>
> what am i missing here - should i be using PIL in some way?
>
Are you perchance running on Windows? If so you must write the files in
binary mode to avoid the content being mangled ("\n" will be replaced by
"\r\n" where
model.
This ordering may not be the most helpful for an impatient beginner, but
it allows a patient one to relatively quickly get a good understanding
of how Django manipulates database content. The ability to use the admin
site to maintain data does meant the views are a little m
give you some guidance as
to how to implement raw SQL. As for the exact details of the counter
reset, you'd need to tell us which database engine you are running against.
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.
ing used the recommended mechanism and reads
import django.newforms as forms
then you simply have to change it to
import django.forms
Otherwise you'll have to change every occurrence of "newforms" to
"forms". The code should work, though, modulo any incompatible ch
from django import newforms as forms
in which case you should change it to
from django import forms
but I hope you've got the idea: basically newforms has *become* forms.
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www
ring* the data is a
problem, since it would really be better if your model had separate
fields for image format, image mode, image size (possibly separating
width and heigh) and compression. Otherwise youo will forever be
fighting to extract meaningful information form the data stored on the
databas
g
> query in a for loop then shuffle it. is there any alternative solution.
A much cheaper solution would be to create a list of range(20),
randomize that with shuffle and use successive elements to index the slice.
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
k footer %}{% endblock %}
>
>
>
>
> If you need more information, just let me know what to post.
>
Looks like it should work. Does it make any difference if you change the
minus signs to underscores?
regards
Steve
--~--~-~--~~-
.com/en/dev/howto/deployment/modpython/#serving-media-files
to see how to configure Apache to serve the files.
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
--~--~-~--~~~---~--~~
You re
A better starting point might be
http://docs.djangoproject.com/en/dev/topics/email/
which the OP will already have seen if he followed Karen's advice.
regards
Steve
megrez80 wrote:
> Start here: http://www.python.org/doc/2.5.2/lib/module-smtplib.html .
>
> Ken
>
>
erField'
And, of course, there's always
In [17]: help(i.get_internal_type)
which tells you:
"""
Help on method get_internal_type in module django.db.models.fields:
get_internal_type(self) method of django.db.models.fields.IntegerField
instance
"""
Not terrifically helpful,
rsion of Python won't see packages installed in another.
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
DragonSlayre wrote:
>
>
> On Jan 25, 6:04 pm, Steve Holden wrote:
>> When you install something by running
>>
>> python setup.py install
>>
>> it gets installed into the python that is used to run setup.py. It looks
>> like you had /usr/local/bi
ass's __init__, so you could just omit it altogether. But I have
assumed you have plans for it ...
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
--~--~-~--~~~---~--~~
You received this me
e on top of all my files:
> # -*- coding: utf-8 -*-
>
> and in my settings:
> DEFAULT_CONTENT_TYPE = 'text/html; charset=utf-8'
>
> and in my form:
> method="post">
>
>
This is caused by something, possibly inside Django, trying to co
That's most easily done by controlling your PATH so the the version you
want to prefer is found first when python is called for.
regards
Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"
DragonSlayre wrote:
>
> On Jan 27, 3:15 pm, Steve Holden wrote:
>
>> DragonSlayre wrote:
>> That's most easily done by controlling your PATH so the the version you
>> want to prefer is found first when python is called for.
>>
>> regards
>>
o template like so:
> {{ user.CalendarLink }} - it just puts the verbatim text - i.e. not
> the markup language. Is there a way to inject raw html into a django
> template? I realize it is a bit unsafe - but this is not going to be a
> public website.
>
> Thanks!
>
Use the "safe" fil
}
>
Neat, but I think you need to correct your first alt string :)
regards
Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-user
DragonSlayre wrote:
>
> On Jan 27, 4:11 pm, Steve Holden wrote:
>
>> DragonSlayre wrote:
>>
>>
>>> On Jan 27, 3:15 pm, Steve Holden wrote:
>>>
>>>> DragonSlayre wrote:
>>>>
>>> How do you
self, *args, **kwargs ):
super( ContactForm, self ).__init__( *args, **kwargs )
regards
Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to d
o someone know some snippets app available somewhere ?
>
>
Maybe there's a snippets app on Django snippets?
http://djangosnippets.org
alas the site has no index, so you may need to call up your Google fu ...
regards
Steve
--~--~-~--~~~---~--~~
You receiv
o someone know some snippets app available somewhere ?
>
>
Hmm, I see cab *is* what drives Django snippets. Sorry 'bout that. If it
needs any updates I am sure James would be happy to consider
contributions. Seems to work fine, though. Why not just give it a try?
regards
Steve
--~--~-~
e usernames and
passwords anyway, sot he "remember me" option isn't used as much as it
used to be.
regards
Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To po
ximum recursion depth exceeded
>
> (I use: beryl:db_settings oleg$ nosetests --cover-package=loginreg
> --with-coverageto run tests)
>
>
>
> Could anyone suggest why I am getting it?
>
Is something doing a 301 redirection to itself, possibly?
regards
Steve
n MySQL, though I don't recall
> where). I see a similar effect on my own MySQL DB, independent of Django.
You may have query caching turned on.
http://www.mysqlperformanceblog.com/2006/07/27/mysql-query-cache/
--
steev
http://www.daikaiju.org.uk/~steve/
--~--~-~--~~
ce for the two tables in the admin.py in the second part of the
> tutorial. It seems to me it's just a "bug" in the tutorial.
>
Technically the only requirement is that apps be loadable, so you can
have an app anywhere on your PYTHONPATH and import it into several sit
follow the trunk or other versions. I even refuse to guarantee that this
email is not a complete lie. Enjoy.
regards
Steve
PS: There's always the websucker.py program if you don't want to do a
local build but need something more recent ...
--~--~-~--~~~--
. And also
occasionally IE6 on the Django server as well.
Anyone got any idea what is going wrong?
Cheers
Steve McCusker
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
has some helpers related to partial functions, but
I haven't had luck tracking down documentation, so any pointers there
are welcome, even if they don't exactly solve my problem. I think I
am doing something a little different from the normal part
Nothing posted is outside a block but it could be that the parent has
no title block?
On Jun 23, 6:47 pm, Karen Tracey wrote:
> On Tue, Jun 23, 2009 at 8:34 PM, nbv4 wrote:
>
> > I'm trying to set up a template for all my forms, but I'm having
> > trouble using the {% with %} block:
>
> > {% ex
On Jun 23, 7:29 pm, Karen Tracey wrote:
> On Tue, Jun 23, 2009 at 10:16 PM, Steve Howell wrote:
>
> > Nothing posted is outside a block but it could be that the parent has
> > no title block?
>
> I can't parse this sentence. The part of the original post where
that most folks who encounter this
gotcha either work around it or go to a different templating system.
The OP is using generics so will probably be wise to stick with django
templates and slightly repetitive code.
On Jun 23, 9:16 pm, Karen Tracey wrote:
> On Tue, Jun 23, 2009 at 11:05 PM, St
On Jun 23, 9:16 pm, Karen Tracey wrote:
>
> Raising some sort of error for child template content found outside of a {%
> block %} seems like a more reasonable idea. I have no idea if it's been
> asked for/considered/rejected/etc., nor how hard it would be to do. If you
> are really intereste
0
(though I couldn't find a straight answer). Can I run the latest
Django on google app engine?
Thanks,
Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to thi
On Jun 29, 11:13 am, nixon66 wrote:
> Steve,
>
> The is a __init__.py
>
Ok, you need to provide a little more detail then. Can you tell us
what your subdirectory structure looks like, and have you put
__init__.py's in enclosing folders?
Sometimes modules fail to import due
o Django/psycopg/Postgres interactions with respect to
setting up transaction management, but I have to admit that most of
the discussion has been over my head.
Thanks,
Steve
P.S. Here is the entire method for get_or_create(), for more context:
def get_or_create(self, **kwargs):
On Jun 29, 11:05 am, nixon66 wrote:
> I'm getting an error no module name x. I've create all the
> directories and I can see them, but I keep getting this error and
> can't understand why. Any ideas. Not sure why this is happening since
> it did not happen when I've created other apps.
Ther
On Jun 30, 10:42 pm, Rex wrote:
> Kind of a petty question:
>
> I've been using PyDev to do my Django work and find it to be great.
> However, my only gripe is that it's hard to keep track of tabs, since
> they display only the (non-qualified) file name, which is a problem
> given Django's very
provide it now.
On Jun 29, 10:53 am, Steve Howell wrote:
> Hi, I have created a management command that populates some tables in
> a Postgres database, and I use the handy get_or_create() method in db/
> models/query.py. I tried running a command recently where I had
> inadvertently
On Jul 7, 3:07 pm, Karen Tracey wrote:
>
>
> > On Jun 29, 10:53 am, Steve Howell wrote:
> > > Hi, I have created a management command that populates some tables in
> > > a Postgres database, and I use the handy get_or_create() method in db/
> > > mode
See below.
On Jul 8, 10:49 am, Karen Tracey wrote:
> On Tue, Jul 7, 2009 at 9:05 PM, Steve Howell wrote:
>
> > On Jul 7, 3:07 pm, Karen Tracey wrote:
>
> > > > On Jun 29, 10:53 am, Steve Howell wrote:
> > > > > Hi, I have created a management command
needed.
Is there anything in django that would facilitate this? If not, my
slightly off-topic question would be how best to do this in postgres.
Essentially, we want some process to generate a log of DB inserts/
updates/deletes on the one side and replay it on the other.
Thanks,
Steve
On Jul 21, 3:18 pm, Wayne Koorts wrote:
> Hi Steve,
>
> > We have an application where we periodically import data from an
> > external vendor, and the process is mostly automated, but we need to
> > review the data before having it go live.
>
> > We were con
(self, fail_silently=False):
"""
Builds and sends the email message.
"""
send_mail(fail_silently=fail_silently, **self.get_message_dict())
Best Regards,
Steve
http://agilitynerd.com
http://googility.com
--~--~-~--~~~
nce to remove.
>
> What is the best way to handle this?
>
>
> Alexey Rudy
>
Alexey,
I found this solution googling for "django one to many delete":
http://fragmentsofcode.wordpress.com/2009/03/06/django-gotcha-related-objects-deleted-by-default/
Best Regards,
Steve
hanks.
>
> I didn't find the Django Calendar. Where can i find some good example
> please ?
>
Hi,
Googling for "django calendar" found this article which contains some links
to other django calendar projects:
http://journal.uggedal.com/creating-a-flexi
p/sessions/#topics-http-sessions
Best Regards,
Steve
--~--~-~--~~~---~--~~
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
Hi everybody,
I´m new in Django and maybe my problem is a bit stupid...I would like
to use a global variable (for all the application) to store some info
that I get in my firts page. I know I can send variables using
render_to_response, but is there any other easy way??is it possible to
define a g
I`ve got an application developed for PCs and I want to make it
available for mobile devices. There are only some slight differences
between booth two versions, so I think is not worth while to develope
different applications. Instead, I've decided to develope an only
application in which I need a
son.dumps(rdata)
return HttpResponse(json, mimetype="application/json")
The JavaScript dutifully evaluates the returned JSON [phobic security risk:
it would be
much better to use a JSON library for this] and replaces any current content
content
of the target span.
Hope this helps.
re-rendered as needed.
'''
class RenderNode(Node):
def __init__(self, var):
self.var = var
def render(self, context):
val = resolve_variable(self.var, context)
try:
return val.render(context)
except:
return val
@
.
Any suggestions you can offer would be greatly appreciated.
I'm using django version 1.0.2 final and Python 2.6.1. If it makes
any difference I'm using the builtin django test server ("manage.py
runserver").
Cheers,
Steve
--~--~-~--~~~---~--~--
ass Email(Model):
sender = CharField(...)
body = CharField(...)
labels = ManyToManyField(Label)
Now I want to retrieve all emails sent by "showard" along with all the
labels applied to each email. I want to do it with a *constant*
number of database queries. How d
On May 20, 10:49 am, Konstantin S wrote:
> On 20 май, 19:43, Steve Howell wrote:
>
>
>
> > To elaborate on Karen's suggestion, one way to see which URLs are
> > among the candidates for resolving the reverse match is to
> > deliberately hit a bad URL like t
On May 20, 6:41 am, Karen Tracey wrote:
> On Wed, May 20, 2009 at 7:28 AM, Konstantin S wrote:
>
> > On 20 май, 14:02, Konstantin S wrote:
> > > Hello!
>
> > > I have a very strange problem and really don't know where to start in
> > > hunting it down. My app uses django-registration, all works
On May 20, 6:33 am, Filip Gruszczyński wrote:
>
> I have recently created a class:
>
> class RequestService:
>
> def __call__(self, request, *args, **kwargs):
> self.prepare(request, *args, **kwargs)
> if request.method == 'POST':
>
On May 26, 6:43 am, Konstantin S wrote:
> On May 20, 2:02 pm, Konstantin S wrote:
>
> > Hello!
>
> > I have a very strange problem and really don't know where to start in
> > hunting it down. My app uses django-registration, all works fine but
> > if I been logged in restart django dev. server
On May 27, 8:23 am, Konstantin S wrote:
> On May 26, 9:28 pm, Steve Howell wrote:
>
> [...]
> > Perhaps you can try to step through the code in the debugger. The top-
> > level method involved in reversing URLs are not super complicated.
> > You can set
On May 28, 7:26 am, "Daniele Procida"
wrote:
> On Thu, May 28, 2009, Masklinn wrote:
> >> I need to create some templates that will cover a number of cases:
>
> >> display navigation menu: yes or no
> >> display additional info box: yes or no
>
> >> In other words, there are a total of fo
On May 28, 8:19 am, jrs_66 wrote:
> 250 queries on one page seems to me to be dangerously high. I would
> have to guess you could reduce that significantly. Turn on query
> output to see if the Django ORM isn't creating sloppy queries in
> loops. My guess is that with some code alterations you
; http://dpaste.com/hold/73229/
>
> Now you just have initialize OrderForm with the flyer_id.
>
dpaste is great for IRC, but it renders the list's historical record
rather less useful than it would have been with the answer inline. I
wonder if you'd mind repeating the code for my
Another option is to install the snippet below, which supports "in":
http://www.djangosnippets.org/snippets/1350/
On Jun 17, 1:53 pm, Ben Davis wrote:
> Nope, you'll need to set a variable in your view. You can also try creating
> your own filter such that {% if friend|is_in_group %} would wo
For those of you who, like me, have enjoyed SmileyChris's excellent
smart if tag, you may find the following extension useful:
http://www.djangosnippets.org/snippets/1572/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
When attempting to use a few management commands together, ala:
from django.core.management.base import NoArgsCommand
from django.core.management.commands import syncdb
from django.core.management.commands import runserver
class Command(NoArgsCommand):
def handle_noargs(self, **options):
The Python install isn't adding the directory containing the Python
executable to your windows PATH. You just need to add
";C:\Python26;C:\Python26\Scripts" to the end of your path (which you can do
in My Computer | Properties | Advanced | Environment Variables.
regards
Steve
I am not fully tracking to the problem here, but when it comes to
overriding save() behavior on forms, I find the following helper to be
handy:
def build_instance_from_form(model_form):
instance = model_form.save(commit=False)
return instance
Then in your view code do something like this:
201 - 300 of 742 matches
Mail list logo