weird learning thingie
hi, i have a site: http://ootygolfclub.org/web/galls/2/ this is built using nesh's thumbnails app. On clicking a photo, you should see full size - but you get a thumbnail. After going back and forth several times, you do get the full size image. What gives? -- regards kg http://www.livejournal.com/users/lawgon tally ho! http://avsap.org.in ಇಂಡ್ಲಿನಕ್ಸ வாழ்க! --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: newbie question about admin module
mahakala wrote: > Hi, everybody > > I just created a simple data entry application in django, and I want to > use contrib admin as the data input interface and the admin user > management, I want the system log which staff user input the every > single line data. I know there is an action history. But I still want > there is a field in each record to log who create it and who last > change it. Is there a special model field can do this?or it must be > done through programming about auth module.? Thanks. In the options for a DateTimeField you can specify auto_now=True and the Admin will autofill it with the "current time" (which becomes the last modified date). There is no current way to do the same with User, but there is a proposed CurrentUserField in the works. -- --Max Battcher-- http://www.worldmaker.net/ --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Puzzling META.unique_together issue
Using Django you don't need to explicitly define the PhotoTag model. Create your Tag model first, then create the Photo model. In the Photo model, include a field like such: tags = meta.ManyToManyField(Tag) The admin interface will render this as a select box where you can select multiple values. More info is available at http://www.djangoproject.com/documentation/model_api/#many-to-many-relationships Cheers, Ross --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django in a Load-Balanced environment (ORM issues) ...
>They way I would enivsage adding this functionality to Django would be >that in your model you specify, for each Model object (=table), that it >is to be versioned. Versioning would automatically add a '_version' >column to the generated DDL, and the standard Django save() routines >would take care of atomically checking and incrementing the row-version >and throwing exceptions if updates fail because of concurrent changes. Another appraoch is not to change the Schema at all. Unneccessary and unrelated fields in the Schema is messy. Instead you can use 'Optimisitic Locking'. All you need to do to perform optimistic locking is add every column you are changing to the where with the old value. The only requirement is to keep the old value. A version might save on memory somewhat, but optimistic locking has he advantage of not needing to alter the schema. So if you load a model up e.g Model.ID = 123 Model.Field1 = 'ABC' and then you change it: Model.Field1 = 'DEF' Model.OldValues['Field1'] = 'ABC' When you save the object you add the old value to the where clause update model.tablename set Field1 = 'DEF' where ID = 123 and Field1 = 'ABC'; This achieves the same effect as a version. An exception can be thrown if the update fails, or handled in any number of ways. --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Help with Django base template and CSS
(r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': 'path/to/document/root/media', 'show_indexes': True}), As a temporary measure you can add a line like this to your urls.py in order to serve media when developing, replacing the path line with an absolute path to your media. Ideally is should be done through your web server though. See: http://www.djangoproject.com/documentation/static_files/ --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Help with Django base template and CSS
error when run manager.py init log show below C:\djangosite>python mytest01\manage.py init Error: Your action, 'init', was invalid. Run "mytest01\manage.py --help" for help. then i try manager.py --help in action list really have no init option! I use the remove magic version. Does anyone know how? thank you. 2006/3/5, thebubblejungle <[EMAIL PROTECTED]>: > > Cheers, > > So if I upload my files to a directory (media) on my Linux server, > www.foo.com say, I need to add: > > /public_html/media/www.foo.com/ to the MEDIA_ROOT > and http://www.foo.com/ to MEDIA_URL to settings.py > > In my base template, can I just use style.css or do I need to point to > the absolute reference of the file? > > m > > > > --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Help with Django base template and CSS
I meant to say "that's just for development, NOT production". On 3/4/06, Wilson Miner <[EMAIL PROTECTED]> wrote: > Django doesn't serve media (images, css, etc.). The development server > handles the media necessary for the admin interface, but that's just > for production. You'll need a regular web server (Apache, lighttpd, > etc.) to serve your media. Once you've got that going, you'll need to > update the MEDIA_ROOT and MEDIA_URL settings in your Django settings > file (see http://www.djangoproject.com/documentation/settings/#media-root > ). > > Hope this helps! > > Wilson > > On 3/4/06, thebubblejungle <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I'm fairly new to Django and have a project at University where I am > > creating a league table manager with a web interface. I'm having > > problems viewing CSS in my templates online i.e. > > http://localhost:8000/leaguemanager/ shows an index page which links to > > style.css, but in the server window I'm seeing a 404 2189 error. > > > > My directory setup is: > > > > /templates > > ../leaguemanager > > style.css > > base.html > > index.html > > /ourproject > > ../leaguemanager > > /models > > > > index.html inherits from base.html, which has references to style.css. > > Everything else seems to be working OK, just not being able to locate > > the style.css file. > > > > Any help would be appreciated, > > > > Mark Hawker > > > > > > > > > --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Help with Django base template and CSS
Django doesn't serve media (images, css, etc.). The development server handles the media necessary for the admin interface, but that's just for production. You'll need a regular web server (Apache, lighttpd, etc.) to serve your media. Once you've got that going, you'll need to update the MEDIA_ROOT and MEDIA_URL settings in your Django settings file (see http://www.djangoproject.com/documentation/settings/#media-root ). Hope this helps! Wilson On 3/4/06, thebubblejungle <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm fairly new to Django and have a project at University where I am > creating a league table manager with a web interface. I'm having > problems viewing CSS in my templates online i.e. > http://localhost:8000/leaguemanager/ shows an index page which links to > style.css, but in the server window I'm seeing a 404 2189 error. > > My directory setup is: > > /templates > ../leaguemanager > style.css > base.html > index.html > /ourproject > ../leaguemanager > /models > > index.html inherits from base.html, which has references to style.css. > Everything else seems to be working OK, just not being able to locate > the style.css file. > > Any help would be appreciated, > > Mark Hawker > > > > --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Catch tag
I'v written a catch tag, and it can catch the output of it content (even sub tag in it), then save the output to a var_name. for example: {% load utiltags %} {% catch as a %} {% now "jS F Y H:i" %} {% endcatch %} Current time is {{ a }} the code is: ---utiltag.py--- from django import template import re register = template.Library() class CatchNode(template.Node): def __init__(self, nodelist, var_name): self.nodelist = nodelist self.var_name = var_name def render(self, context): output = self.nodelist.render(context) context[self.var_name] = output return '' def do_catch(parser, token): """ Catch the content and save it to var_name Example:: {% catch as var_name %} ... {% endcatch %} """ try: tag_name, arg = token.contents.split(None, 1) except ValueError: raise template.TemplateSyntaxError, "%r tag requires arguments" % token.contents[0] m = re.search(r'as (\w+)', arg) if not m: raise template.TemplateSyntaxError, '%r tag should define as "%r as var_name"' % (tag_name, tag_name) var_name = m.groups()[0] nodelist = parser.parse(('endcatch',)) parser.delete_first_token() return CatchNode(nodelist, var_name) do_catch = register.tag('catch', do_catch) I hope this tag will be helpful. -- I like python! My Blog: http://www.donews.net/limodou NewEdit Maillist: http://groups.google.com/group/NewEdit --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: unable to install admin
On Saturday 04 Mar 2006 3:05 pm, Kenneth Gonsalves wrote: > line 164, in _fetch > app = getattr(__import__(appname[:p], {}, {}, > [appname[p+1:]]), appname[p+1:]) > ImportError: No module named webdjango.contrib solved - a missing comma -- regards kg http://www.livejournal.com/users/lawgon tally ho! http://avsap.org.in ಇಂಡ್ಲಿನಕ್ಸ வாழ்க! --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django in Boo
On Saturday 04 March 2006 05:12, wizeman wrote: > Think about it. Python was an esoteric language in the beginning. And > Boo isn't that esoteric, it can be thought of as an extension to the > Python syntax. > And virtually all .NET libraries can be used in Boo, it runs on the > .NET/Mono runtime. The .NET libraries are very unpythonic. They are about the last libraries I'd *want* to use if I were using python or a python-like language. For example: all the public method names start with capital letters (so they look like classes); only instances are first class objects; there are huge numbers of unwieldy collection classes (now in untyped, strongly typed and generic flavours) instead of a few good ones etc. etc. The only languages I've seen that the .NET libraries work well with are C# and VB.NET (and VB.NET is really just C# 1.0 without the curly braces -- yes, really). For the same reason I'm not particularly drawn to using IronPython in my day job, even if I could, because I'd still have to use .NET libraries for the projects I work on. Luke -- "The first ten million years were the worst. And the second ten million, they were the worst too. The third ten million, I didn't enjoy at all. After that I went into a bit of a decline." (Marvin the paranoid android) Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/ --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Dreamhost - agh!
I also use Dreamhost without any problems.I think my Django projects run on avalon server Regards, L. --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---