Re: FormWizard and @login_required

2008-09-27 Thread Steve Holden
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

Re: FormWizard and @login_required

2008-09-27 Thread Steve Holden
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

Re: Hidding form field based on logged on user

2008-09-28 Thread Steve Holden
() return HttpResponseRedirect("/") else: if request.user.is_superuser: form = formclass(instance=d) return render_to_response('domain_form.html', {"form": form}, context_inst

Re: Hidding form field based on logged on user

2008-09-28 Thread Steve Holden
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

Re: Hidding form field based on logged on user

2008-09-29 Thread Steve Holden
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

Re: DateField range searches

2008-09-29 Thread Steve Holden
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

Re: Django vs. Liferay

2008-09-29 Thread Steve Holden
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

Many to Many where two fields in one model are related

2008-09-30 Thread Steve Bergman
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

Re: Many to Many where two fields in one model are related

2008-09-30 Thread Steve Bergman
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

Re: Questions about HttpResponseRedirect and reverse

2008-10-03 Thread Steve Holden
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 --~--~-~--~~~---~--

Re: Recursive relationship - two models, same table

2008-10-04 Thread Steve Holden
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

Re: add() method on ManyToManyField

2008-10-04 Thread Steve Holden
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

Re: Where to put initializing code

2008-10-05 Thread Steve Holden
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

Re: Questions about HttpResponseRedirect and reverse

2008-10-05 Thread Steve Holden
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

Re: Too many values to unpack

2008-10-07 Thread Steve Holden
; 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

Re: generic.date_based.archive_year throws "invalid literal for int() with base 10: ''

2008-10-07 Thread Steve Holden
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 "

Re: random quote help

2008-10-07 Thread Steve Holden
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

Re: Branching proj/myapp into branch/0.1/myapp breaks

2008-10-08 Thread Steve Holden
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

Re: random quote help

2008-10-08 Thread 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.

Re: Django-Registration and NewForms Error

2008-10-08 Thread Steve Holden
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

Re: array grouping in templates

2008-10-12 Thread Steve Holden
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

Re: Building Django web application

2008-10-12 Thread Steve Holden
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

Re: allowing users to create and edit content types without editing model classes

2008-10-14 Thread Steve Holden
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

Re: unable to get rid of app name via rewrite

2008-10-14 Thread Steve Holden
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

Re: modelForm

2008-10-14 Thread Steve Holden
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

Re: No module named core

2008-10-14 Thread Steve Holden
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/ --~--~-~--~--

Re: Non-Programmer Help: filter_interface error?

2008-10-15 Thread Steve Holden
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

Re: Deploy application in bytecode

2008-10-15 Thread Steve Holden
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

Re: Deploy application in bytecode

2008-10-15 Thread Steve Holden
[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

Re: Deploy application in bytecode

2008-10-15 Thread Steve Holden
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

Re: Deploy application in bytecode

2008-10-15 Thread Steve Holden
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

Re: Deploy application in bytecode

2008-10-15 Thread Steve Holden
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

Re: Deploy application in bytecode

2008-10-15 Thread Steve Holden
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

Re: save existing jpg to model

2008-10-16 Thread Steve Holden
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

Re: How to get a page in Django?

2008-10-17 Thread Steve Holden
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

Re: delete tables

2008-10-17 Thread Steve Holden
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.

Re: newforms question

2008-10-17 Thread Steve Holden
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

Re: newforms question

2008-10-17 Thread Steve Holden
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

Re: Getting lists/dictionaries out of the database

2008-10-17 Thread Steve Holden
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

Re: ordering a query set randomly

2008-10-17 Thread Steve Holden
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

Re: Named URL Patterns

2008-10-17 Thread Steve Holden
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 --~--~-~--~~-

Re: missing template for admin

2008-10-19 Thread Steve Holden
.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

Re: How to send emails when after an event happened?

2008-10-20 Thread Steve Holden
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 > >

Re: Use _meta.fields to return the datatype

2009-01-24 Thread Steve Holden
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,

Re: sqlite3 problems setting up

2009-01-24 Thread Steve Holden
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

Re: sqlite3 problems setting up

2009-01-25 Thread Steve Holden
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

Re: Strange Model behavior

2009-01-26 Thread Steve Holden
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

Re: Target anchor on div's id (/account/#divid ) + Redirection after a POST = ascii encode problem

2009-01-26 Thread Steve Holden
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

Re: How to change python version in ubuntu???

2009-01-26 Thread Steve Holden
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 "

Re: How to change python version in ubuntu???

2009-01-26 Thread Steve Holden
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 >>

Re: Embed HTML snippets through django

2009-01-26 Thread Steve Holden
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

Re: trouble with yesno to generate images

2009-01-27 Thread Steve Holden
} > 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

Re: How to change python version in ubuntu???

2009-01-27 Thread Steve Holden
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

Re: Form validated before submitted

2009-01-27 Thread Steve Holden
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

Re: Snippets app ?

2009-01-31 Thread Steve Holden
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

Re: Snippets app ?

2009-01-31 Thread Steve Holden
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 --~--~-~

Re: remember me on this computer vs SESSION_EXPIRE_AT_BROWSER_CLOSE

2009-01-31 Thread Steve Holden
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

Re: Nosetests. maximum recursion depth exceeded

2009-02-03 Thread Steve Holden
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

Re: A Very Puzzling MySQL Issue Performance...

2009-02-06 Thread Steve McConville
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/ --~--~-~--~~

Re: Strange "problem" with tutorial

2009-02-07 Thread Steve Holden
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

Re: Documentation for Download?

2009-02-15 Thread Steve Holden
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 ... --~--~-~--~~~--

New browser opened on different computer seems to be logged as user already.

2009-06-20 Thread Steve McCusker
. 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

currying variables into ModelForm subclasses

2009-06-23 Thread Steve Howell
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

Re: why doesn't the "with" template tag transverse blocks?

2009-06-23 Thread Steve Howell
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

Re: why doesn't the "with" template tag transverse blocks?

2009-06-23 Thread Steve Howell
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

Re: why doesn't the "with" template tag transverse blocks?

2009-06-23 Thread Steve Howell
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

Re: why doesn't the "with" template tag transverse blocks?

2009-06-24 Thread Steve Howell
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

Sharing a development site cheaply (free as in beer?)

2009-06-28 Thread Steve Hershman
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

Re: no module name xxxx error

2009-06-29 Thread Steve Howell
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

get_or_create() returns "no such savepoint" error

2009-06-29 Thread Steve Howell
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):

Re: no module name xxxx error

2009-06-29 Thread Steve Howell
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

Re: PyDev users: how do you manage tabs?

2009-07-01 Thread Steve Howell
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

Re: get_or_create() returns "no such savepoint" error

2009-07-07 Thread Steve Howell
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

Re: get_or_create() returns "no such savepoint" error

2009-07-07 Thread Steve Howell
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

Re: get_or_create() returns "no such savepoint" error

2009-07-08 Thread Steve Howell
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

replicating database changes from one postgres DB to another

2009-07-21 Thread Steve Howell
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

Re: replicating database changes from one postgres DB to another

2009-07-23 Thread Steve Howell
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

Re: How to send form via email

2009-07-29 Thread Steve Schwarz
(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 --~--~-~--~~~

Re: Removing objects with many-to-many relationship

2009-07-30 Thread Steve Schwarz
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

Re: Handle event on a django event Calendar

2009-07-30 Thread Steve Schwarz
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

Re: Passing an object between views

2009-08-02 Thread Steve Schwarz
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

Using glovar vars

2009-08-14 Thread Steve Patrick
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

Re: Using glovar vars

2009-08-17 Thread Steve Patrick
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

Re: how to return an html snippet using ajax $.post()?

2009-08-20 Thread Steve Holden
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: Template tags and variables overlapping

2009-05-03 Thread Steve Howell
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 @

Separate Admin for each Site

2009-05-06 Thread Steve R
. 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 --~--~-~--~~~---~--~--

Gathering related objects for a set of objects, across a many-to-many relationship

2009-05-07 Thread Steve Howard
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

Re: Weird problem in url resolving after restarting django dev. server

2009-05-20 Thread Steve Howell
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

Re: Weird problem in url resolving after restarting django dev. server

2009-05-20 Thread Steve Howell
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

Re: Callable objects instead of functions in views.py

2009-05-20 Thread Steve Howell
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': >                        

Re: Weird problem in url resolving after restarting django dev. server

2009-05-26 Thread Steve Howell
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

Re: Weird problem in url resolving after restarting django dev. server

2009-05-27 Thread Steve Howell
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

Re: Mutiple template inheritance

2009-05-28 Thread Steve Howell
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

Re: Problem with performance on a django site

2009-05-28 Thread Steve Howell
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

Re: Using CheckboxSelectMultiple with a many to many relationship.

2009-05-30 Thread Steve Holden
; 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

Re: Template Question

2009-06-17 Thread Steve Howell
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

ANN: elif added to smart_if tag

2009-06-17 Thread Steve Howell
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

runserver via code runs twice...

2009-09-24 Thread Steve Motola
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):

Re: Command (Windows+R >cmd) Python

2009-11-20 Thread Steve Holden
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

Re: Issue when saving a model form

2009-11-27 Thread Steve Howell
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:

<    1   2   3   4   5   6   7   8   >