Re: Basic SQL

2008-11-03 Thread Tonne
I think I may be barking up the wrong tree, and if so please excuse the above. I now suspect that I should be associating the images with their relevant entries with template tags. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

Re: link to other record in admin change list

2008-11-03 Thread Fabio Natali
Chris wrote: [...] > I have set up a callable in the admin.py, but the HTML I eject there > gets escaped, so that I end up seeing etc in the > list, instead of the link. Here is the relevant piece of admin.py: Hi Chris! Did you try with varchars.allow_tags? http://docs.djangoproject.com/en/dev/

link to other record in admin change list

2008-11-03 Thread chris
Dear Django users, Here is a question I can't find an answer for in the docs and from Mr. Google. In an admin list display, I have set up a column that displays records that are related to the current record. Now I want to be able to directly open that related record, instead of the record that

Re: Django on Apache (mod_python) administration cookie problem

2008-11-03 Thread Graham Dumpleton
On Nov 4, 5:08 pm, Dave Dash <[EMAIL PROTECTED]> wrote: > I am witnessing this issue using manage.py runserver. > > The only useful information I can give is this was working when I was > running .97 (or whatever was the trunk a few months back), I recently > upgraded to the latest trunk (~1.1)

Re: Django on Apache (mod_python) administration cookie problem

2008-11-03 Thread Dave Dash
I am witnessing this issue using manage.py runserver. The only useful information I can give is this was working when I was running .97 (or whatever was the trunk a few months back), I recently upgraded to the latest trunk (~1.1) and now continually get this message. I suspect something has chan

Basic SQL

2008-11-03 Thread Tonne
*disclosure* I am SQL novice, okay */disclosure* I have what I think is a very simple problem, but can't seem to find a solution without writing raw SQL. I have 2 (simplified here) models: class Entry(models.Model): title = models.CharField(max_length=80) class Image(models.Model):

Newb testing question

2008-11-03 Thread Rick Kitts
Greetings. I'm digging django pretty good. Many thanks. I've run into a problem that I'm sure is my fault but I don't know why yet. I've got a ModelForm and I'm trying to write unit tests for the validation bits. My strategy here was to construct an instance of the form and populate it with

strptime() working in python, but not within django?

2008-11-03 Thread mpobrien
I'm working on something that involves parsing out a date from a string, so i'm using the datetime.strptime() function. I've noticed that this works correctly in python, but when i run it within a django environment it doesn't seem to work. Example, in python: [EMAIL PROTECTED]:~/projects/mu_tool

Re: Template inheritance

2008-11-03 Thread pk
One simple way to think about template inheritance (which is a GREAT feature) is to think of it as "specialization": You first define the general look of a website, the logo, banner, menu bars, footers. All that goes into the base template A. In fact, you can render just the base template A and s

Re: Forms Question

2008-11-03 Thread [EMAIL PROTECTED]
Yep, you need to do the if is_valid() stuff, but other than the save() method it works like a normal form, more or less. On Nov 3, 8:07 pm, Robocop <[EMAIL PROTECTED]> wrote: > I tried that earlier but i failed terribly at syntax.  Should it be: > > f = ModelForm(request.POST) > f.save() > > On N

Re: Beginner on Django and web developing

2008-11-03 Thread DULMANDAKH Sukhbaatar
> Hello folks, I have aready used python only in desktop. About 1 a week > ago I installed the Django 1.0 on Fedora 9. I wonder about the > djangobook, its version is 0.96 or 1.0? book's version is 1.0, but written for 0.96. -- Regards Dulmandakh --~--~-~--~~~---~-

Re: Forms Question

2008-11-03 Thread Robocop
I tried that earlier but i failed terribly at syntax. Should it be: f = ModelForm(request.POST) f.save() On Nov 3, 5:37 pm, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > On Nov 4, 2008, at 8:14 AM, Robocop wrote: > > > > > > > I'm working with some rather long forms, and i've processed them in

Re: Using settings.py mechanism for application settings

2008-11-03 Thread pk
To clarify the question a bit more, I am talking about an "app" in the sense of a reusable component that is developed by me but want to distribute for others to use. James is right that for any of my own app, I can just tell the user to put in some settings in the project level settings.py file.

Re: Forms Question

2008-11-03 Thread Eric Abrahamsen
On Nov 4, 2008, at 8:14 AM, Robocop wrote: > > I'm working with some rather long forms, and i've processed them in a > pretty basic way. I read in the post data for every field, then just > create a new table entry using the form data. > > Something like: > if request.method == 'POST': > if fo

Forms Question

2008-11-03 Thread Robocop
I'm working with some rather long forms, and i've processed them in a pretty basic way. I read in the post data for every field, then just create a new table entry using the form data. Something like: if request.method == 'POST': if form.is_valid(): var_a = form.cleaned_data['var_a'] v

Re: Using Django

2008-11-03 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I understand the mapping of urls.py but I guess I'm not clear on a few > things to begin with, like what is the equivalent to an index.html > page in django? I know that the system works off of a template system > like using "base.html" as the design skeleton for a site

Re: Using Django

2008-11-03 Thread [EMAIL PROTECTED]
I understand the mapping of urls.py but I guess I'm not clear on a few things to begin with, like what is the equivalent to an index.html page in django? I know that the system works off of a template system like using "base.html" as the design skeleton for a site and extending that system with ca

Re: Beginner on Django and web developing

2008-11-03 Thread David Zhou
On Mon, Nov 3, 2008 at 4:07 PM, Airton Arantes <[EMAIL PROTECTED]>wrote: > > > > > Note that the book is pretty out of date at this point, and some sections > -- > > like the Admin site -- will simply not work. > > Your best bet is to go through the tutorials on the Django documentation > > site.

Re: Beginner on Django and web developing

2008-11-03 Thread Airton Arantes
2008/11/3 David Zhou <[EMAIL PROTECTED]>: > On Mon, Nov 3, 2008 at 2:49 PM, bruno desthuilliers > <[EMAIL PROTECTED]> wrote: >> >> On 3 nov, 17:38, "Airton Arantes" <[EMAIL PROTECTED]> wrote: >> > Hello folks, I have aready used python only in desktop. About 1 a week >> > ago I installed the Djang

Re: Admin behavior: what is errors.items in change_form.html?

2008-11-03 Thread Karen Tracey
On Mon, Nov 3, 2008 at 2:16 PM, nazar <[EMAIL PROTECTED]> wrote: > > I met some unusual behavior in my project in admin change form with > inlines. There is code in template change_form.html: > > {% blocktrans count errors.items|length as counter %}Please correct > the error below.{% plural %}Plea

Re: Beginner on Django and web developing

2008-11-03 Thread David Zhou
On Mon, Nov 3, 2008 at 2:49 PM, bruno desthuilliers < [EMAIL PROTECTED]> wrote: > > On 3 nov, 17:38, "Airton Arantes" <[EMAIL PROTECTED]> wrote: > > Hello folks, I have aready used python only in desktop. About 1 a week > > ago I installed the Django 1.0 on Fedora 9. I wonder about the > > djangob

Re: access request.user in class Meta

2008-11-03 Thread bruno desthuilliers
On 1 nov, 23:57, Merrick <[EMAIL PROTECTED]> wrote: > I am trying to dynamically generate a form, the fields will vary if > the user is logged in. Here is where I am so far > > forms.py > == > class LinkForm(ModelForm): > > def __init__(self, *args, **kw): > self.request = kw.pop('

Re: Beginner on Django and web developing

2008-11-03 Thread bruno desthuilliers
On 3 nov, 17:38, "Airton Arantes" <[EMAIL PROTECTED]> wrote: > Hello folks, I have aready used python only in desktop. About 1 a week > ago I installed the Django 1.0 on Fedora 9. I wonder about the > djangobook, its version is 0.96 or 1.0? > > I don't know nothing about web programming but I'm st

Admin behavior: what is errors.items in change_form.html?

2008-11-03 Thread nazar
I met some unusual behavior in my project in admin change form with inlines. There is code in template change_form.html: {% blocktrans count errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} Template can't evaluate 'er

Re: Strange admin validation behaviour.

2008-11-03 Thread Karen Tracey
On Sun, Nov 2, 2008 at 12:07 PM, jiussa <[EMAIL PROTECTED]> wrote: > > Hi > > Been working through the online tutorial without problems up to the > end of part 3. However if I now go back to the admin and try to edit > choices for a Poll I get an error message saying "Please correct the > errors b

Re: How to rename uploaded files in FileField?

2008-11-03 Thread bovine
thank u very much!, I think that can solve my problem. On 11月4日, 上午12时38分, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On Mon, Nov 3, 2008 at 11:04 AM, Chen Yinliu <[EMAIL PROTECTED]> wrote: > > I've searched this group and find some related mails, but their solutions > > seem out of date, for ex

Beginner on Django and web developing

2008-11-03 Thread Airton Arantes
Hello folks, I have aready used python only in desktop. About 1 a week ago I installed the Django 1.0 on Fedora 9. I wonder about the djangobook, its version is 0.96 or 1.0? I don't know nothing about web programming but I'm studying a lot. Can I read this link[1] to learn better about django?

Re: How to rename uploaded files in FileField?

2008-11-03 Thread Marty Alchin
On Mon, Nov 3, 2008 at 11:04 AM, Chen Yinliu <[EMAIL PROTECTED]> wrote: > I've searched this group and find some related mails, but their solutions > seem out of date, for example: > http://gulopine.gamemusic.org/2007/nov/07/customizing-filenames-without-patching/ > but there is no _save_FIELD_fil

How to rename uploaded files in FileField?

2008-11-03 Thread Chen Yinliu
I've searched this group and find some related mails, but their solutions seem out of date, for example: http://gulopine.gamemusic.org/2007/nov/07/customizing-filenames-without-patching/ but there is no _save_FIELD_file method there, the underline file storage system had been refactored in 1.0 rele

AW: Custom clean methods for admin site?

2008-11-03 Thread Bülent Aldemir
Create methods with like: class MyModel(models.Model): mystring = models.CharField(max_length=100) class MyForm(forms.ModelForm): def clean_mystring(self): raise forms.ValidationError('Error Message') -Ursprüngliche Nachricht- Von: django-users@googlegroups.com [mailto

Custom clean methods for admin site?

2008-11-03 Thread krase
Hi, i am trying to build an authorisation system for the admin site. The authorisation should not only be based on user, group and type of the object, but also on contents the user just typed in. I assume that i have to override the clean() methods of the ModelAdmin classes. First i tried this:

Re: Python package names

2008-11-03 Thread Valts Mazurs
Sure, I also keep django apps outside site-packages directory but it is not really the same level of convenience :) Valts. On Mon, Nov 3, 2008 at 4:07 PM, Jonathan Buchanan < [EMAIL PROTECTED]> wrote: > > On Mon, Nov 3, 2008 at 1:59 PM, Valts Mazurs <[EMAIL PROTECTED]> wrote: > > Usually Django

Re: Update a a single field

2008-11-03 Thread darryl.hebbes
Aah yes that worked. Thanks Daniel. To clarify my own thoughts, a python example: For example, setattr(x, 'foobar', 123) is equivalent to x.foobar = 123 On Nov 3, 3:44 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Nov 3, 1:41 pm, "darryl.hebbes" <[EMAIL PROTECTED]> wrote: > > > > > Hi, >

Re: Python package names

2008-11-03 Thread Jonathan Buchanan
On Mon, Nov 3, 2008 at 1:59 PM, Valts Mazurs <[EMAIL PROTECTED]> wrote: > Usually Django applications are specific to Django and are not really usable > outside Django. That's why seeing "tagging" in my site-packages directory > might confuse me as I could think that this package supports some gen

Re: Python package names

2008-11-03 Thread Dj Gilcrease
On Mon, Nov 3, 2008 at 6:59 AM, Valts Mazurs <[EMAIL PROTECTED]> wrote: > Usually Django applications are specific to Django and are not really usable > outside Django. That's why seeing "tagging" in my site-packages directory > might confuse me as I could think that this package supports some gen

Re: Python package names

2008-11-03 Thread Valts Mazurs
Usually Django applications are specific to Django and are not really usable outside Django. That's why seeing "tagging" in my site-packages directory might confuse me as I could think that this package supports some general tagging. Valts. On Mon, Nov 3, 2008 at 3:51 PM, James Bennett <[EMAIL PR

Re: Python package names

2008-11-03 Thread James Bennett
On Mon, Nov 3, 2008 at 6:23 AM, Dj Gilcrease <[EMAIL PROTECTED]> wrote: > Cause I actually like having the django_apps namespace so I can > quickly identify if something being imported is a django app or some > regular python module A Django application *is* a Python module. It's not some secret

Re: Update a a single field

2008-11-03 Thread Daniel Roseman
On Nov 3, 1:41 pm, "darryl.hebbes" <[EMAIL PROTECTED]> wrote: > Hi, > > I want to do something like this, I wish to make the 'fieldname' > dynamic, I am just trying to update a field without a hard coded > name... the name is passed in via  a form. > > --- > def updateProfile(request):

Update a a single field

2008-11-03 Thread darryl.hebbes
Hi, I want to do something like this, I wish to make the 'fieldname' dynamic, I am just trying to update a field without a hard coded name... the name is passed in via a form. --- def updateProfile(request): fieldname = request.POST["id"] fieldid = int(request.POST["

Re: align a ModelForm

2008-11-03 Thread Thomas Guettler
limas schrieb: > Can i align a single long ModelForm into two raws? > can i use django admin modules for my own purpose by customizing it? > please give me some suggestions . > Yes, you can do both. Suggestion: Read the documentation. Suggestion: http://docs.djangoproject.com/en/dev/ref/c

Re: Python package names

2008-11-03 Thread Dj Gilcrease
On Mon, Nov 3, 2008 at 4:24 AM, Steve Holden <[EMAIL PROTECTED]> wrote: > Why not just add .../site-packages/django_apps to your PYTHONPATH, > making direct imports from that directory possible? That seems much > easier than modifying the source, and it's a standard Python mechanism. Cause I actu

Re: Django's decoupling apps but template should couple them together, right?

2008-11-03 Thread Steve Holden
bruno desthuilliers wrote: > > On 3 nov, 03:56, Steve Holden <[EMAIL PROTECTED]> wrote: > (snip) > >> You might also want to look into ContextManager objects, which are a way >> of providing information to all pages. >> > > I assume you meant 'Context processors' ?-) > > Are you some ki

Re: Django's decoupling apps but template should couple them together, right?

2008-11-03 Thread bruno desthuilliers
On 3 nov, 03:56, Steve Holden <[EMAIL PROTECTED]> wrote: (snip) > You might also want to look into ContextManager objects, which are a way > of providing information to all pages. I assume you meant 'Context processors' ?-) --~--~-~--~~~---~--~~ You received th

Re: Python package names

2008-11-03 Thread Steve Holden
Dj Gilcrease wrote: > I run into this issue all the time since I put all of my apps in > "site-packages/django_apps/*", the only thing you can do is manually > change the imports to fit your naming structure > The ONLY thing? > So for all mine I have to edit the imports and prepend "django_apps.

Re: help for RSS Feed

2008-11-03 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-11-03, o godz. 11:59, przez please smile: > Can anybody please send me a small RSS feed application using django. > Thanks. Google code has plenty of them. -- We read Knuth so you don't have to. - Tim Peters Jarek Zgoda, R&D, Redefine [EMAIL PROTECTED] --~--

Join of any db table with Q.add_to_query

2008-11-03 Thread Dima Dogadaylo
Before merging of queryset-refactor it was possible to join any table with any ON clause to any queryset with help of Q.as_sql. For example, please see this one: http://www.djangosnippets.org/snippets/257/ Since Django 1.0 ORM looks like more complicated, Q.as_sql is disappeared (but still mentio

Re: Overriding admin templates

2008-11-03 Thread Lars Stavholm
Lars Stavholm wrote: > Karen Tracey wrote: >> On Sat, Nov 1, 2008 at 5:54 PM, Lars Stavholm <[EMAIL PROTECTED] >> > wrote: >> >> Low Kian Seong wrote: >> > http://www.djangobook.com/en/1.0/chapter17/ >> >> Yes, thank you, that's it. >> >> It worked nicely

help for RSS Feed

2008-11-03 Thread please smile
Hi All , Can anybody please send me a small RSS feed application using django. Thanks. --~--~-~--~~~---~--~~ 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@googlegro

Re: Django's decoupling apps but template should couple them together, right?

2008-11-03 Thread Dj Gilcrease
On Mon, Nov 3, 2008 at 2:48 AM, ilmarik <[EMAIL PROTECTED]> wrote: > I've got controllers made as logical apps (controllers named > particularly) and whenever I need f.e. menu inside base layout, I > simply put {#menus/show/1} which means - return here compiled > controllers(menus) method(show) of

Re: Django's decoupling apps but template should couple them together, right?

2008-11-03 Thread Benjamin Buch
Am 03.11.2008 um 02:33 schrieb ilmarik: > It's just simple amazing that I waste another night to figure out how > to glue two and more apps together inside one template. > I read about custom tags and I thing it isn't (or at least it > shouldn't be) the way of doing it. too much fuss imho. > > E

Re: Python package names

2008-11-03 Thread Horst Gutmann
Do you absolutely require the name or would it be enough for you to have an isolated environment for your django-related packages? In this case take a look at virtualenv and to some extend also buildout :-) http://pypi.python.org/pypi/virtualenv http://pypi.python.org/pypi/zc.buildout -- Horst

Re: Django's decoupling apps but template should couple them together, right?

2008-11-03 Thread ilmarik
> A slightly fuller description of your intended page structure might let > people provide more accurate answers to your needs. Let http://pow.dzierzoniow.pl be my fuller explanation. This page is my old project written in php on Kohana framework. There is one 'app' used to generate both menus (i

Re: Overriding admin templates

2008-11-03 Thread Lars Stavholm
Karen Tracey wrote: > On Sat, Nov 1, 2008 at 5:54 PM, Lars Stavholm <[EMAIL PROTECTED] > > wrote: > > > Low Kian Seong wrote: > > http://www.djangobook.com/en/1.0/chapter17/ > > Yes, thank you, that's it. > > It worked nicely for the change_form.html e

Re: Python package names

2008-11-03 Thread Dj Gilcrease
I run into this issue all the time since I put all of my apps in "site-packages/django_apps/*", the only thing you can do is manually change the imports to fit your naming structure So for all mine I have to edit the imports and prepend "django_apps." for all of the internal imports (eg. "from dj

Re: Python package names

2008-11-03 Thread Daniel Roseman
On Nov 3, 7:47 am, stryderjzw <[EMAIL PROTECTED]> wrote: > Hmm, I tried django_tagging, but it still gives me ImportErrors.  I > think it's because, for django-tagging project, they internally look > for tagging as the package name. Yes I realised that after I posted - sorry. There's nothing to

AW: __str__, __unicode__ representation of model fields

2008-11-03 Thread Bülent Aldemir
Thanks for your reply. Maybe my question was a bit misleading: where do I put default representations for each model field on model level (not templates). I want to have a nice representation for the other MyModel() fields. Must I define for each field a method to accomplish my task? class My

align a ModelForm

2008-11-03 Thread limas
Can i align a single long ModelForm into two raws? can i use django admin modules for my own purpose by customizing it? please give me some suggestions . --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django use

Re: Keeping track of online users

2008-11-03 Thread 燕子翔
so,how can i use it in GAE? 2008/11/3 JoeJ <[EMAIL PROTECTED]> > > > Are you looking for something like 'django-tracking' ?? > http://code.google.com/p/django-tracking/ > > I was just perusing this last night, for use on a site of mine. > > -- joe > > > On Nov 1, 3:52 pm, "[EMAIL PROTECTED]" > <