Re: django-registration not reflecting changes to forms and views

2009-06-24 Thread David De La Harpe Golden
neri...@gmail.com wrote: > I tried adding more form fields to the > registration form and the changes would never show with touch > dispatch.fcgi, Which fcgi implementation are you using? Assuming apache2 web server, note that the common (since it's in debian and derivatives by default) mod_fcgi

file extensions for templates

2009-07-01 Thread David De La Harpe Golden
Hi, As far as I can see, django shouldn't care in the slightest about template file name extensions, but being a django newbie, I could have missed something (e.g. autosetting of a mime type somewhere based on extension), so just to verify - it doesn't? (considering moving to an extra file exten

Re: file extensions for templates

2009-07-02 Thread David De La Harpe Golden
Rajesh D wrote: > Right. > > http://docs.djangoproject.com/en/dev/ref/templates/api/#the-template-dirs-setting > > Quote: They can have any extension you want, such as .html or .txt, or > they can have no extension at all. > Ah, thanks. (add-to-list 'auto-mode-alist '("\\.html\\.djt\\'" .

Re: django-registration .missing templates?

2009-07-20 Thread David De La Harpe Golden
Reiner wrote: > The documentation states that you need to write these templates > yourself, no examples are included with the package. > However, IIRC (I may not, ended up not using django-registration in the end due to differing workflow requriements) the templates that are included in the djan

Re: Template tags as parameter to template tag

2009-07-21 Thread David De La Harpe Golden
phoebebright wrote: > Is there a way to get this to work: > > {% for tag in tags %} > {% tag_link > "{{tag.name}}" %} > {% endfor %} > > > The outer loop is using the standard tagging application and the > tag_link is my custom template tag which has a di

Re: Template and substitute

2009-08-04 Thread David De La Harpe Golden
Malcolm Tredinnick wrote: > You seem to be trying to create raw SQL using Django's template system. > Please don't do that. It's like trying to use a shovel to hammer in a > nail, but less effective. Pybatis, FWIW, is an sql templating thingy. Using jinja2 rather than django templates, just men

Re: Help building a custom RadioSelect widget.

2009-08-04 Thread David De La Harpe Golden
Sam Walters wrote: > Any help completing/explaining this would be greatly appreciated and > open the floodgates towards understanding how to do this for all sorts > of pythonic/django overloading scenarios. > I had to do something similar a while back - http://python.pastebin.com/f7a905977 Pro

dropping django admin change password urls

2009-08-11 Thread David De La Harpe Golden
I'm using a simple ldap authentication backend, and the admin password change functionality may need to be disabled or mangled to do the right thing (currently going for disabled, can just redirect to different password change form), as it changes the django User model password, which at best wil

Re: Strange problem with LDAP authentication backend

2009-08-12 Thread David De La Harpe Golden
stupidgeek wrote: > def get_user(self, username): > try: >user = User.objects.get(username=username) >print user >return user > except User.DoesNotExist: > return None > Note part of the auth backend protocol AFAICS involves c

Re: Strange problem with LDAP authentication backend

2009-08-13 Thread David De La Harpe Golden
stupidgeek wrote: > David, you are a champ, thank you. > I find it strange that this made the difference, since this line is in > the docs: > > "The get_user method takes a user_id -- which could be a username, > database ID or whatever -- and returns a User object." > We-ell, the "user_id" it

Re: UnicodeEncodeError on csv export

2009-08-20 Thread David De La Harpe Golden
andreas schmid wrote: > hi, > > i successfully made a csv export view for a queryset but i have the > problem with some characters... > how can i encode the queryset passed to the csv writer to solve my problem? > FWIW, I just did the following: for line in lines: writer.writerow

Re: Django templates have lexical scope!?

2009-08-26 Thread David De La Harpe Golden
stevedegrace wrote: > Variables you bind within the template itself don't seem to behave > this way. > > Instead they are scoped. If a variable is bound inside a block tag, > the binding is only valid within that block. I didn't do enough > experiments yet to tell you how it behaves with nested

Re: Django scalability with files

2009-08-27 Thread David De La Harpe Golden
Lewis Taylor wrote: > Is there a better solution django offers, and why are > blobs not supported. ideally i would have the image stored in DB and > that way there would never be sync issues. > FWIW (which given you're concerned about scaling mightn't be all that much), it's fairly straightforw

Re: Editors of choice

2009-09-08 Thread David De La Harpe Golden
gnu emacs with ropemacs and nxhtml (has django template mode) packages. --~--~-~--~~~---~--~~ 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: breadcrumb solution

2009-09-09 Thread David De La Harpe Golden
Mike Dewhirst wrote: > I would like to get breadcrumbs working in a simple way. Could anyone > please help? > Is there a better way? One thing you can do is a "pure template" based breadcrumb or pseudo-breadcrumb, assuming you have a template inheritance graph with different views rendering dif

Re: File Field max size and admin interface

2009-09-15 Thread David De La Harpe Golden
Peter Bengtsson wrote: > Sadly this means that if a user tries to upload a 11Mb file you won't > be able to confront them with a user-friendly "error" message. > It's pretty straightforward to subclass django.forms.fields.FileField to apply a size limit in clean(), or perhaps just do the check

Re: javascript problem

2009-09-18 Thread David De La Harpe Golden
Oguz Yarimtepe wrote: > not django: I think,you are using the "Prototype" javascript framework? IIRC you _really_ should be using Event.observe(window,'load', function () { ... }); to do stuff the "prototype way". http://www.prototypejs.org/api/event/observe Dunno if that's the actual issue (I

Re: date inside url

2009-09-18 Thread David De La Harpe Golden
dijxtra wrote: > and here is what I want to put in my template: > > {% url day year={% now "Y"%} month={% now "m"%} day={% now "d"%} %} > > but, ofcourse, I won't put that in my template because you can't have > tag inside of a tag. This may fall into the "just because you can doesn't mean you

Re: How to establish foreign key contraints across models living in different applications

2009-09-28 Thread David De La Harpe Golden
guillermooo wrote: > > I suppose you mean in terms of performance? Could you please elaborate > on the disadvantages? > They're not database-level foreign keys. So no db-level integrity checks. You also can't presently use them in an easy manner in more complex queries (aggregation). They mi

Re: Menu managements, current URL

2009-09-30 Thread David De La Harpe Golden
Maksymus007 wrote: > I'm looking for simple way of managing menu - so my question is - how > i can get currently used URL? > I'm presently using a very simple template-based menu scheme, as each view tends to use a separate template. I don't need to worry about the url. Hardly the be-all and end

Re: Multi-db support

2009-10-15 Thread David De La Harpe Golden
Jeff Bell wrote: > My problem occurs during larger queries - I get 'Too many connections' > error. If I run these queries through django's default manager they > are handled fine. Can anyone point me in the right direction, maybe > the source code where django handles this. I'm pretty sure I n

Re: Django default date formatting changes

2009-10-16 Thread David De La Harpe Golden
vishak wrote: > what you have told is OK but when you enter in datefield 10-OCT-09 > instead of 2009-10-10 it gives error. > If you don't tell a forms.DateField to expect 10-OCT-09, it won't. Django's DateField default input format list doesn't include that particular '%d-%b-%y' format by defaul

Re: efficiently deleting content based on how old it is

2009-10-21 Thread David De La Harpe Golden
Jaime Buelta wrote: > When I had to do this kind of tasks, I've added a new management command and > run it from the cron (or manually any time you need it, with params, etc). > You can run it calling > > python manager.py miCommand parameters > "celery" may seem overkill initially, but works v

Re: Which apps/solutions are most appropriate for model based search in Django?

2009-10-22 Thread David De La Harpe Golden
>>> That is, a search on students >>> is essentially an answer to the question "Show students that belong to >>> the following schools, and who belong to the following states, and who >>> have the following degrees / diplomas". N.B. That in particular does sound like what might sometimes be calle

Re: Versionable Models?

2009-10-28 Thread David De La Harpe Golden
Tim Chase wrote: > Back to the topic on hand, there are several ways to do > model-versioning. I'm partial to having a FooHistory table that > mirrors the parent table's fields but has a timestamp associated > with it. The most recent one is always the Foo object, but > before a Foo is sav

Re: Colored HTTP status codes

2009-10-29 Thread David De La Harpe Golden
Russell Keith-Magee wrote: > I'm not convinced that a single setting is the right approach for > this. It almost seems like this is something that we should be using > environment variables or a dot file (e.g., a .djangorc with system > wide Django settings) - although this introduces a dependen

Re: Display Certain Fields of the Model Formset As Text

2009-11-02 Thread David De La Harpe Golden
Preston Holmes wrote: > When using widget.attr how does one specify a attr that is name only, > not key/value. > > The disabled key is not a k/v attr: > > > In xhtml 1 (fwiw) it is, you are required to write disabled="disabled" (I think) and it is also allowed to do so in html 4 See section

Re: Django 1.1.1 - Can't get form validation working

2009-11-02 Thread David De La Harpe Golden
Karen Tracey wrote: > On Mon, Nov 2, 2009 at 8:55 AM, Andrew wrote: >> I have a form... as you can see I have "required=True" on the username >> to test validation >> class RegistrationForm(forms.Form): >>username = forms.CharField(required=True), >>email = forms.EmailField(required=True

Re: debug toolbar problem

2009-11-02 Thread David De La Harpe Golden
FWIW, djangologging can also show you any sql queries during request-response, with LOGGING_LOG_SQL = True in settings.py http://code.google.com/p/django-logging/wiki/Overview I don't know if or how debugtoolbar and djangologging are related, but djangologging is working nicely for my show-me-sq

Re: Django 1.1.1 - Can't get form validation working

2009-11-02 Thread David De La Harpe Golden
Karen Tracey wrote: > Ah, right. Thanks for pointing out the explanation. Doing something to > make Django fail loudly for stuff like this (I recall it tripping up someone > once on a model definition as well) might be worthwhile. The current > no-error-but-really-confusing-results behavior is

Re: Multi-db support

2009-11-02 Thread David De La Harpe Golden
David De La Harpe Golden wrote: > Here's something further pared down I'm currently testing with django > 1.1.1 to tide us over until true multi-db for our own simple > multi-postgresql-database case. It "seems to work", though doesn't > address a bun

Re: Accessing 'bytea' field using django.

2009-11-04 Thread David De La Harpe Golden
ds99 wrote: > Hi, > I am using django with postgres as backend. Some of the fields in the > table are of type "bytea"(bytearray). Which django fields should I use > while defining a model for such tables? > > for eg: To access "boolean" we use BooleanField while modelling. I > want to know how to

Re: Dynamic content in the database

2009-11-04 Thread David De La Harpe Golden
Peter Harley wrote: > Hi all, > > I was wondering if anyone had any suggestions on how to approach what I > imagine is a fairly common issue. > > Say for example I'm developing a blog app (just to reinvent the wheel > again). In my blog posts I want to link to something else on my site. > No

Re: form with loop over fields?

2009-11-11 Thread David De La Harpe Golden
andreas schmid wrote: > hi , > > i need to create an input form with a input field for every month for > lets say 10 years. > so the form has 10*12 = 120 exact same input fields. > Do you mean tabular sort of form? gross deductible 2009-11-11 [...] [...] 2009-11-10 [...] [...] so

Re: datetime problems with Django application

2009-11-11 Thread David De La Harpe Golden
BEC wrote: > Any idea on what is going on here? I'm particularly perplexed as to > why the admin page and my view are giving different times. > That does sound weird. What database are you using? Not an immediate help, but the sane way to handle timezones in django in my experience: (0) don'

Re: form with loop over fields?

2009-11-12 Thread David De La Harpe Golden
teField() datum = models.IntegerField(null=True) > > David De La Harpe Golden wrote: >> andreas schmid wrote: >> >>> hi , >>> >>> i need to create an input form with a input field for every month for >>> lets say 10 years.

Re: Scanning uploads for viruses

2009-11-13 Thread David De La Harpe Golden
Brandon Taylor wrote: > Greetings all, > > My project involves uploading Word documents (resumes), and I would > like to be able to scan them for viruses. I've found ClamAV, but > installation is proving a little testy. So, I thought I'd ping the > community for advice. Should I even be concerned

Re: casting unicode to model

2009-11-19 Thread David De La Harpe Golden
Karen Tracey wrote: > Undocumented internal routine, but unlikely to change: > Just to note the contenttypes framework has a documented way: http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#methods-on-contenttype-instances from django.contrib.contenttypes.models import ContentType

Re: time date formatting

2009-11-23 Thread David De La Harpe Golden
matches wrote: > If I want to format the current datetime for an rss feed, I do: > > {% now "r" %} > > I want to format a date the same way coming from a DB in this format > "2009-11-18 08:00:00" > > Is there a way to format it with that same "r" format from a template > level? > > This clearly

Re: Per-object permissions

2009-11-24 Thread David De La Harpe Golden
gamliel roi wrote: > Hello all, > > I have the admin site up and running but I need to create a group of users, > such that each of the users will be able to edit objects that are only > relevant to them (e.g Project objects that the user is also the > ProjectManager). > > I know that in the past

Re: Unexpected OSError when deleting an image

2009-11-26 Thread David De La Harpe Golden
philip.bar...@impaerospace.com wrote: > I tried editing django/core/files/storage.py to output the results of > an os.access() check to show that I did have write access to the image > file immediately before attempting the os.remove. It showed that I had > write access to the image file. > You

Re: Best UI for letting users select an item from a large selection of records?

2009-11-26 Thread David De La Harpe Golden
Stodge wrote: > Offering the user a drop > down combo box of requirements to choose from isn't the best option. Rant: combo box /means/ a text entry widget plus dropdown menu "combo". For some reason web developers in particular seem prone to using it to mean a dropdown alone (html forms sadly l

Re: Unexpected OSError when deleting an image

2009-11-26 Thread David De La Harpe Golden
philip.bar...@impaerospace.com wrote: > I ran 'ps aux | grep apache' which showed that apache was running > under the www-data user account. Okay. (Aside: Note that you can use something like mod_wsgi in daemon mode or mod_fcgid to run django processes under a separate user account to the main apa

Re: Best UI for letting users select an item from a large selection of records?

2009-11-27 Thread David De La Harpe Golden
Stodge wrote: > Thanks. I have the DataTables plugin working so I can filter my > records. Now I just need to work out how to select specific ones from > the table and work with them. > Well, that depends a bit on what you want. if you, say, used javascript to directly populate a field in a html

Re: Sick of defining urls

2009-12-04 Thread David De La Harpe Golden
Todd Blanchard wrote: > > I've solved my urls problem for now (though I'm open to more > elegant solutions) Depends what you're doing, but if what you're doing fits into its "chained views" convention, django-catalyst will also autogen relevant urls for you - http://code.google.com/p/django-cata

Re: Unique model field and case sensitivity (postgres)

2009-12-07 Thread David De La Harpe Golden
chefsmart wrote: > By the way, right now I'm using a State.objects.get(name__iexact=name) > in clean_name() method in a form subclass to prevent creation of case- > insensitive duplicates. Just wondering if there is a built-in or > better way. > Well, in postgresql itself one can make a case insen

Re: How to change default template name for django.views.defaults.page_not_found ?

2009-12-08 Thread David De La Harpe Golden
mateusz.szulc wrote: >>From Django Part 3 tutorial: > "The 404 view is also called if Django doesn't find a match after > checking every regular expression in the URLconf." > > The 404 default view in django is defined as: > def page_not_found(request, template_name='404.html'): > > How can I cha

Re: import twice when run test

2009-12-09 Thread David De La Harpe Golden
>> Python treats them as >> two different files, and hence the signal is attached twice. > -> models.signals.post_save.connect(flaggedentry_post_save, > sender=FlaggedEntry) > Or is there likely to be something else we've got wrong > in our app? > Well, just in case - watch out for the dispatch

Re: How can child objects inherit data from parents?

2009-12-10 Thread David De La Harpe Golden
bruno desthuilliers wrote: > First point, you have a tree structure. There are a couple ways to > handle trees in a relational model, each has pros and cons. The most > obvious one is the recursive relationship (also known as 'adjacency > list'): > > create table Person( >id integer primary k

Re: return a dynamically generated image to the user?

2009-12-10 Thread David De La Harpe Golden
Alexander Dutton wrote: > > The alternative would be to stick an Alias in your apache conf (assuming > you're using apache) to serve the files directly from the filesystem. > This solution wouldn't let you perform any authorisation, though. > N.B. There is nowadays the X-SendFile thing, should b

Re: contributing code legalities

2009-12-14 Thread David De La Harpe Golden
http://www.djangoproject.com/foundation/cla/ -- 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...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroup

Re: Cron vs event triggered action

2009-12-15 Thread David De La Harpe Golden
Tim Daniel wrote: > So how can I implement solution B? Is there a posibility to create a > cron on a user action that executes only one time? > > NOTE: I don't want to rely on a thread that should stay alive for two > hours ore more inside the server memory. Well, celery uses a "celeryd" daemon

Re: Understanding of File Upload in Django

2009-12-15 Thread David De La Harpe Golden
sjtirtha wrote: > But what I understand from the documentation is uploading and saving are two > different processes. How can I trigger the saving then? > First, certainly, when a file is uploaded from a client, django puts it somewhere *temporary* initially. You may have conceptualised that as

Re: Logout and session

2009-12-17 Thread David De La Harpe Golden
Victor Loureiro Lima wrote:. > auth system is in fact invalidating my current session id cookie, but > afterwards it sets a new session id cookie, why does it do that? > Um. So that anonymous users of your site still have sessions? Django supports "anonymous sessions", sessions and auth are diffe

Re: Logout and session

2009-12-21 Thread David De La Harpe Golden
On Thu, Dec 17, 2009 at 03:54:02PM -0200, Victor Loureiro Lima wrote: > Okay, let me further explain my problem... > > My website depends heavilly on the caching system, I'm using cache_page to > cache my view ( using memcached backend ), > however I have the "Hello, " on top of every page when

Re: Cron vs event triggered action

2009-12-21 Thread David De La Harpe Golden
On Sat, Dec 19, 2009 at 06:28:23AM -0800, Tim Daniel wrote: > David, Celery sounds really good, thanks for the tip, I'll have a > deeper look into it as soon as I've got some time, if I can't get it > one question: Is it capable of running on every web server > that supports Python? Well, it's ki

Re: Logout and session

2009-12-21 Thread David De La Harpe Golden
On Mon, Dec 21, 2009 at 12:52:24PM -0200, Victor Loureiro Lima wrote: > Well, template caching invalidates view cache right? Plus, my understanding > of the template cache is that > it will hit my view, do all the DB stuff, but skip the template processing > which takes a while to finish, is my un

Re: How do you rollback a transaction outside the context of a request?

2010-04-15 Thread David De La Harpe Golden
On 14/04/10 23:15, Bill Freeman wrote: The trouble is, I don't know how. Just calling django.db.transaction.rollback() doesn't work, and neither do several other guesses. N.B. Despite eventually signalling a TransactionManagementError if django doesn't "think" it's in a transaction-managed

Re: Using external dbs... is django 1.2 the best solution?

2010-04-21 Thread David De La Harpe Golden
On 21/04/10 11:21, Massimiliano della Rovere wrote: I am developing a web site that has some of its models in a private database (the one specified in settings.py, populated by the admin interface) but, it has to fetch and filter (etc) data from 2 different databases So what is you opinion, sh

Re: Why doesn't my isinstance() work?

2010-04-23 Thread David De La Harpe Golden
On 22/04/10 04:34, Lachlan Musicman wrote: I presume this will make you all wince, but while appreciating the discussion I've caused I've solved it thusly: views.py def index(request): all_authors = Author.objects.all() all_origAuthors = [] all_translators = Transl

Re: usage of TIME_ZONE and zone-to-zone conversion

2010-04-28 Thread David De La Harpe Golden
Thanks for the tip on pytz. It might be what I need. See django-timezones, django-related helpers around pytz: http://github.com/brosner/django-timezones its LocalizedDateTimeField model/form fields construct non-naive python datetimes with pytz tzinfo. (see its tests.py for some additio

Re: How create M2M through with out PK?

2010-05-19 Thread David De La Harpe Golden
On 19/05/10 10:42, Daniel Roseman wrote: How remove PK from table "libs_content_has_people" and don't use it? You can't. Why would you want to? Well, the natural primary key for a M2M table is quite typically composite and django's ORM just doesn't support composite primary keys right now

Re: Django Sphinx Foreign key search

2010-05-20 Thread David De La Harpe Golden
On 13/04/10 09:04, urukay wrote: Hi, I'm trying to create full text search on model, everything goes fine when searching TextFields but I have a problem with ForeignKey field. How can i do that? Can anyone point me to the right direction? Do you mean you want the results for Model2 searches

Re: New product django-queries

2010-05-31 Thread David De La Harpe Golden
On 31/05/10 11:55, Guthy Peter wrote: Dear Django users, I have written a new module for Django: it's called django-queries, and is sort of a mix between the Admin and the Databrowse products. While the Admin interface is for entering data, django-queries is intended for searching the entered in

Re: limit on date in postgres/django

2010-06-09 Thread David De La Harpe Golden
On 09/06/10 12:23, Wim Feijen wrote: Hello, Do you know whether there is a minimum to a date? Well there is, at the postgresql level, dates are supported between 4713 BC and 5874897 AD http://www.postgresql.org/docs/8.4/static/datatype-datetime.html Maybe there's some text to date parser lev

Re: Dumping large database

2010-06-14 Thread David De La Harpe Golden
On 14/06/10 04:15, Jeff Green wrote: I was wondering what would be the best method of trying to dump a large database. I am trying to migrate from postgresql to oracle, using django 1.2.1 I have been unsucessful in using dumpdata. One interesting point - django 1.2 supports multiple connections

Re: Actions after HttpResponse rendered?

2010-06-21 Thread David De La Harpe Golden
On 21/06/10 06:46, DaNmarner wrote: There's a similar question as mine on stackoverflow.com: http://stackoverflow.com/questions/1081340/how-do-you-do-something-after-you-render-the-view-django and there isn't a satisfactory answer there. Basically, how do I do some thing after a view returns t

Re: Django logging

2010-06-23 Thread David De La Harpe Golden
On 23/06/10 16:48, thusjanthan wrote: Hi, I am creating a new django framework and figured django would come with its own logging feature. I found this one that Fraser wrote but is no longer in development (http://code.google.com/p/django-logging/ wiki/Overview) That's wasn't really for loggin

Re: Is {% cycle ... as ... %} supposed to output a value?

2010-07-07 Thread David De La Harpe Golden
On 07/07/10 17:27, Bill Freeman wrote: > I agree that the "as" clause makes me expect it to render nothing, but it > has worked this way at least back to 1.0, so I guess changing it is not > an option. hypothetical, could add an "only" clause maybe to preserve backward compat? {% cycle 'odd' 'eve

Re: Dajax or Jquery

2010-07-12 Thread David De La Harpe Golden
On 12/07/10 11:36, Imad Elharoussi wrote: > Hi, > > I want to know what's the best plugin of Ajax to use with django Dajax or > Jquery (for someone who just began in developping with such technologies) > They don't do the same thing? jquery is a purely client-side javascript toolkit, whereas daj

Re: reversing admin urls

2010-07-12 Thread David De La Harpe Golden
On 12/07/10 11:27, bigfudge wrote: > Hi - is it possible to reverse admin urls for user-apps? For example, > if I have an app named "Survey" and a model named "Question", is there > a consistent format for reversing the url to edit this model in the > admin interface (by default this would be /admi

Re: altering the sessions class

2010-07-15 Thread David De La Harpe Golden
On 14/07/10 19:42, T.L wrote: > So, I am using request.sessions in one of my views functions but I > want to add a few more fields to the Session class so it will be > customized for my project. > To sum it up, can anyone tell me some way to customize the Session > class to my liking? > It see

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread David De La Harpe Golden
On 15/07/10 13:40, justin jools wrote: > 2. base.html with jquery nav, exactly the same except for > {{ MEDIA_URL }} which is correct. > FWIW, we use a jquery load line in our base template and it works fine (pretty disastrous for us if it didn't). You're 100% sure the pathss correct (like when

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread David De La Harpe Golden
On 15/07/10 15:19, justin jools wrote: > > $(document).ready(function() { > $('#nav li a').click(function() { > $('.active').removeClass('active'); > $(this).addClass(

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread David De La Harpe Golden
On 15/07/10 16:31, justin jools wrote: > I thought I had solved but I haven't. > [...] > using seperate block nav for evey page seems like a lot of > duplication... Well, you could also pass through a context variable to the template from each of your view functions telling what item in your navba

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread David De La Harpe Golden
On 15/07/10 18:00, natebeacham wrote: > Or, if you don't want to over complicate things... Heh. yes, well. :-) Though doing it on the server does mean it stays working for people who disable javascript. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: import model from other module

2010-07-19 Thread David De La Harpe Golden
On 18/07/10 20:58, Andreas Pfrengle wrote: > This should import a database-based timer I've written. In fact, code > from django_timer seems to be imported, since 'test' is printed when I > execute "manage.py syncdb" - however, the database table is not > created. Why? What would I need to change

Re: Django memory requirements

2010-07-19 Thread David De La Harpe Golden
On 19/07/10 14:41, Tereno wrote: > Hi there, > > I have a few questions about Django deployment on production so > hopefully you can help me sort it out. > > Firstly, what's the minimum memory requirements for a Django + Apache > + mod_wsgi setup? It seems like my server ran out of memory when I

Re: Not reflecting MEDIA_URL value

2010-07-20 Thread David De La Harpe Golden
On 20/07/10 12:11, barun wrote: > > [gallery/views.py] > def index(request): > return render_to_response('base.html', {}) > You have to pass through a RequestContext() for the template context processor that injects MEDIA_URL ('django.core.context_processors.media') into to the template

Re: import model from other module

2010-07-21 Thread David De La Harpe Golden
On 20/07/10 20:04, Andreas Pfrengle wrote: > I've tried it with and without installing in settings.INSTALLED_APPS, > didn't work, table wasn't created vis syncdb. > > David, nevertheless the link you've posted gave me the clue how to > solve the problem. I've defined my external module's class a

Re: custom tag and filtered value

2010-07-21 Thread David De La Harpe Golden
On 20/07/10 22:57, owidjaya wrote: > how can i pass a filtered value to a custom tag? > > ie > if i do this > > > {% somecustomtag template_variable|lower %} > The django sources for the standard tags show the method, make sure you are calling parser.compile_filter() on the relevant arg. htt

Re: What goes in 500.html?

2010-07-26 Thread David De La Harpe Golden
On 24/07/10 20:14, Michael Hipp wrote: > What should go in a proper 500.html page? As little as you can get away with; it's for when your server has screwed up. However, you probably want to make it distinguishable from the apache-level 500 page, in a manner you can ask a user reporting a failur

Re: HTTP POST sent from app to Django Server returns 403 Forbidden

2010-07-28 Thread David De La Harpe Golden
On 28/07/10 03:45, Kieran Farr wrote: > Finally figured out what's going on. > > My hypothesis: > An HTTP request with POST method sent to a Django view wrapped with > @csrf_exempt will still raise a 403 CSRF error if the wrapped view > raises an Http404 exception. > Ah, but was your handler404

Re: generate cache by visiting protected links

2010-07-29 Thread David De La Harpe Golden
On 29/07/10 16:16, Jirka Vejrazka wrote: > I personally don't like spawning another thread in a > request-response cycle, but if it works for you, be happy with it :) IIRC it's not really safe, at least in the django/apache case, the whole serving process may be considered fair game to be killed

Re: generate cache by visiting protected links

2010-07-29 Thread David De La Harpe Golden
On 29/07/10 16:58, Benedict Verheyen wrote: > So calling a thread once from within a view is not safe ? Depends on what your expectations are... I haven't managed to dig up the paragraph discussing the issue that I recall existing. I've a strong feeling it was by Graham Dumpleton, he mentions in

Re: Jquery-ui in admin: c is undefined

2010-08-05 Thread David De La Harpe Golden
On 05/08/10 08:59, Alessandro Ronchi wrote: > Is there a way to avoid attaching two times the same jquery library in > admin? Well, the noConflict(true) is a Feature, deliberately decoupling the bundled jquery the admin uses from any jquery (and other "$" snaffling libraries - the "true" stops it

Re: duplicate post_save signals

2010-08-18 Thread David De La Harpe Golden
On 18/08/10 07:48, Kenneth Gonsalves wrote: > hi, > > I am using a two post_save signal handlers for two different models. On > certain conditions they have to send emails to me and others. At times > one signal is generated, at other times two or even in one instance 4 > signals were generated, w

Re: Get request path without having a request object

2010-08-27 Thread David De La Harpe Golden
On 27/08/10 14:22, Sells, Fred wrote: > I'm not sure of the thread safety of Django and wonder if I could store > this object as a local variable of some module like No, that is not likely to work except in a single-threaded* context, and even then it's a bit fraught (just being single-threaded s

Re: Model validation for non-django-orm databases

2010-08-30 Thread David De La Harpe Golden
On 30/08/10 06:07, onelson wrote: > I've read that a "hack" around this kind of issue is to use the meta > unique_together property and almost arbitrarily set primary_key on one > of the fields. That sounds great, except for the fact that I've got > no guarantee that any given field will actually

Re: Model validation for non-django-orm databases

2010-08-30 Thread David De La Harpe Golden
On 30/08/10 15:12, Owen Nelson wrote: > I just started to wonder if the ORM would, I don't > know... "freak out" on the off-chance I run a query that returns a set of > objects with duplicate values on what is supposed to be the pk. Nah, you just get multiple objects back with the same "pk", map

Re: Does anyone have the completed and fully-working code from the Tutorial?

2010-09-07 Thread David De La Harpe Golden
On 07/09/10 16:44, Erskine wrote: > I've spent a few days working through the First App tutorial, and have > mostly got everything working, but I haven't been able to figure out > why I'm getting an extra slash appended after 'polls' when clicking on > the name of the poll > The current URL, poll

Re: How to add a FileField to a dynamically created form

2010-09-08 Thread David De La Harpe Golden
On 07/09/10 20:56, ranjan.kumar wrote > forms.FileField(upload_to='some_dir/') > > The error message that i'm getting is: init() got an unexpected > keyword argument ‘upload_to’ > You're confusing forms.FileField [1] and models.FileField [2] The latter is the one that takes the upload_to

Re: Three Django forms in different tabs in one template?

2010-09-13 Thread David De La Harpe Golden
On 13/09/10 12:48, Stodge wrote: > one view can't support > three forms? Uh, it certainly can if you want to write it that way: Multiple django "form" objects can validate different parts of some request.POST dataset, you're not limited to one post one form. You can even use multiple instances o

Re: Separating application media from project media

2010-09-29 Thread David De La Harpe Golden
On 29/09/10 09:34, Benedict Verheyen wrote: > In my template i add this: > href="{{MEDIA_URL_CALLTRACKING}}/style/login.css" /> > (I'd favour prefix rather than suffix if you're going to pseudo-namespace) Did you introduce such a MEDIA_URL_CALLTRACKING variable into the template context by any

Re: How to specify NULL as the default of a model field.

2010-10-11 Thread David De La Harpe Golden
On 09/10/10 08:06, Tim Diggins wrote: > It may seem odd but I want to explicitly specify NULL as the default > for a particular field / column. (This is so that South picks up that > the default value is null, rather than there being no default > specified, which is what happens if you specify "nul

Re: How do I use JQuery UI tabs with Django (or other tab-solution)?

2010-10-13 Thread David De La Harpe Golden
On 13/10/10 08:14, Torbjorn wrote: > In my first shot > I got the tabs nice looking, one template for each tab and I can > navigate between the tabs, but, when I do something on a tab, for > instance posting a form, I would like to get back to that tab. How do > I do that? > Well, django is serv

Re: How do I use JQuery UI tabs with Django (or other tab-solution)?

2010-10-13 Thread David De La Harpe Golden
On 13/10/10 16:17, Torbjorn wrote: > Thanks for the replies. > > Jonathan: No I'm not stuck to JQuery, I will consider dojango. Thanks > [Another thing to be aware of is dajaxproject.com] > Third Okay, so you _are_ using the tabs' ajax mode. > That works, but when I choose tab Third and post

Re: How do I use JQuery UI tabs with Django (or other tab-solution)?

2010-10-13 Thread David De La Harpe Golden
On 13/10/10 17:55, David De La Harpe Golden wrote: > it's one > place you could put the ajaxification script since jquery takes pains sorry, meant to finish that sentence - "takes pains to make dom injection of scripts tags work" - see discussion @ http://api.jquery.co

Re: Legacy database with a table, which has no separate primary key

2010-10-15 Thread David De La Harpe Golden
On 15/10/10 12:15, Alexander wrote: > As you can see the 'rating' table has no separate primary key field. Yeah, that is pretty commonplace (though not presently supported by django), the natural primary key for a table may be composite... > Here are the models created by Django with some my cor

Re: Different logins in same browser session and login_required

2010-10-19 Thread David De La Harpe Golden
On 19/10/10 17:03, Bill Freeman wrote: > This is a limitation of the browser. It does not keep separate credentials > for separate windows. This is usually desirable because you may choose > to open a link in a new window (or tab) and you still expect to be logged in. > IE8 (and probably other

  1   2   >