How to send custom value to the SelectMultiple Widget

2009-01-21 Thread Lee
Hi, everyone. I have some trouble in SelectMultiple Widget. The detailed information is that: In the form.py, I have defined a TestForm which contain a SelectMultiple Widget called selection #form.py class TestForm(forms.Form): selection = forms.CharField( widget=forms.SelectMultiple() )

Need help changing the ordering of a queryset stored in session

2009-01-21 Thread Brandon Taylor
Hi everyone, I need to do some table sorting and paging. To reduce trips to the DB, I'm storing my initial queryset in a session using the file system backend for local development. I was thinking I might be able to use the dictsort filter and just pass in the column as a variable to do the

Re: Model.save() vs. ManyToMany

2009-01-21 Thread David Gordon
Hi Malcom, > Please post a small example fragment demonstrating what you're trying to > do. Here's the problem code: class Xeme(models.Model): """Grapheme, phoneme, morpheme, etc - any linguistic entity representable by a string.""" text =

Re: Possible Model Inheritance Issue? Error: [Model_Name] instance needs to have a primary key value before a many-to-many relationship can be used

2009-01-21 Thread Keyton Weissinger
OK. I figured it out and it was VERY STRANGE. Maybe some one reading this can tell me WWWHHHYYY my solution works. For now, it's voodoo to me... Turns out that some of my code (in the view where I was having trouble) called some code that looked sort of like this: field_list =

Re: RESTful PUT request

2009-01-21 Thread junker37
Thanks! The trailing slash was indeed my problem. For those that come upon this later, if you're sending json data, use django.utils.simplejson.loads(request.raw_post_data) to convert the data into a python dict. On Jan 21, 7:25 pm, Malcolm Tredinnick wrote: > On

Auth section not showing in admin interface

2009-01-21 Thread Greg Taylor
Does anyone have any idea why the "Auth" section wouldn't show up in the admin display? Here's my APPS: INSTALLED_APPS = ( 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes',

Re: RESTful PUT request

2009-01-21 Thread Malcolm Tredinnick
On Wed, 2009-01-21 at 16:47 -0800, junker37 wrote: > Thanks, I see the request.raw_post_data now in my middleware class, > however, that request never gets to my view, but instead is sent back > as a 301 redirect and then the request_post_data is gone. A 301 redirect is effected as a GET

Context and Variable.resolve

2009-01-21 Thread Andrew Ingram
Hi all, I'm writing the render method of a template tag, and I want to make the format of the tokens quite flexible. I have a dict of args, some in the format 'string', some just numbers like 50 and others references to context variables. I am wondering if there's an elegant way of resolving

Re: RESTful PUT request

2009-01-21 Thread junker37
Thanks, I see the request.raw_post_data now in my middleware class, however, that request never gets to my view, but instead is sent back as a 301 redirect and then the request_post_data is gone. I'm guessing one of the other middleware classes is causing that, but I couldn't figure out which

Re: Writing your first Django app, part 2 error in using http://127.0.0.1:8000/admin/

2009-01-21 Thread Karen Tracey
On Wed, Jan 21, 2009 at 2:55 PM, bconnors wrote: > > in followingWwriting your first Django app, part 2 > > when I typed in: http://127.0.0.1:8000/admin/ > > I got: > > [snip] File "C:\Python26\Lib\site-packages\django\views\defaults.py", line > 23, in server_error >

Re: Model.save() vs. ManyToMany

2009-01-21 Thread Malcolm Tredinnick
On Wed, 2009-01-21 at 14:01 -0800, David Gordon wrote: > Hi Folks, > > I'm aware that foreign key fields such as manytomany don't update > during the save() method of Model, and that there are some issues > surrounding relations to 'self'. I have a model which has a couple of > utility functions

Re: MultiValueDictKeyError when accessing POST items

2009-01-21 Thread Malcolm Tredinnick
On Mon, 2008-12-22 at 19:03 -0800, DragonSlayre wrote: > I've created my own form: > > > Login: > Username: > > Password: > > > > > I am mappying /accounts/login/ to a view of mine, which is then > calling: > > if request.method == 'POST': > username =

Re: Ongoing problems with django-registration installation.

2009-01-21 Thread Karen Tracey
On Wed, Jan 21, 2009 at 2:21 PM, NoviceSortOf wrote: > > > Karen: > > Thanks again, you are right I had the userprofile installed instead of > django-profiles > installed. > > I went to the bitbucket django-registration link you mentioned before > and downloaded the

Re: ManyToManyField in both models

2009-01-21 Thread Malcolm Tredinnick
On Wed, 2009-01-21 at 07:05 -0800, Evgeniy Ivanov (powerfox) wrote: > Hi, > > I've returned to the problem and noticed, that recipe described in the > docs is a kind of wrong: intermediary model is just a kind of M2M (I > mean multiselection) since you have select widgets for inline model > and

Re: RESTful PUT request

2009-01-21 Thread Malcolm Tredinnick
On Wed, 2009-01-21 at 07:01 -0800, junker37 wrote: > I can't seem to get django to handle a PUT request. > > I've googled quited a bit and there seems to be some RESTful > interfaces available for django, however, I can't seem to get any of > them to work because the PUT request gets a 301

Re: Sessions being written twice?

2009-01-21 Thread Malcolm Tredinnick
On Wed, 2009-01-21 at 05:23 -0800, Iqbal Abdullah wrote: > Hi Malcolm, > > Thank you for the tip! > I see now that in my particular code example above, the idea of using > session id and manually setting it through the request can only work > if the session id itself doesn't change after i've

Re: TypeError: Related Field has invalid lookup: icontains

2009-01-21 Thread Karen Tracey
On Wed, Jan 21, 2009 at 3:04 PM, Alessandro Ronchi < alessandro.ron...@soasi.com> wrote: > > 2009/1/21 Karen Tracey : > > On Wed, Jan 21, 2009 at 10:21 AM, Alessandro Ronchi > > wrote: > >> > >> When one tries to make a search in admin with a

Model.save() vs. ManyToMany

2009-01-21 Thread David Gordon
Hi Folks, I'm aware that foreign key fields such as manytomany don't update during the save() method of Model, and that there are some issues surrounding relations to 'self'. I have a model which has a couple of utility functions to update two such relations, and I've found that they don't do

Re: [admin] can i use both a ModelAdmin and an Inline for the same model class? How?

2009-01-21 Thread Karen Tracey
On Wed, Jan 21, 2009 at 4:37 PM, TeenSpirit83 wrote: > > I'm developing a little webapp starting from the contrib.admin > at the moment i manage a class in the model with a modeladmin class > but i need to edit the entries as a tabular inline of another class. > if i

[admin] can i use both a ModelAdmin and an Inline for the same model class? How?

2009-01-21 Thread TeenSpirit83
I'm developing a little webapp starting from the contrib.admin at the moment i manage a class in the model with a modeladmin class but i need to edit the entries as a tabular inline of another class. if i write both the inline and the modeladmin classes in admin.py and try to register them both,

Re: MultiValueDictKeyError when accessing POST items

2009-01-21 Thread esatterwh...@wi.rr.com
I've run into a similar problem, but am trying to submit the form with a text link and java script. The submit element is on the page, but hidden. and I get the same error: HTML -- http://media.muskegohitmen.com

Re: MultiValueDictKeyError when accessing POST items

2009-01-21 Thread esatterwh...@wi.rr.com
HTML http://media.muskegohitmen.com/images/ siteLogo_sm.png"/> Username: Password: LoginForgot Password ?! # JS - there is a little mootools in there, but though that might be the problem so I used the document. to see if that would do it function

Re: Possible Model Inheritance Issue? Error: [Model_Name] instance needs to have a primary key value before a many-to-many relationship can be used

2009-01-21 Thread Keyton Weissinger
Hmm. Thanks Martin. I will try with the SVN HEAD revision. I have already tried the Student(**mydict) approach and get the exact same issue. I will test tonight and respond. Thanks very much for taking time... Keyton On Jan 21, 3:24 pm, Martin Conte Mac Donell wrote: >

Re: Enforce requirement for a UserProfile in admin

2009-01-21 Thread Delta20
Anybody have any ideas? The validators approach I mentioned can't work because UserProfile is not a field of UserChangeForm. Is there a way I can add a validation requirement to UserAdmin (i.e. the ModelAdmin)? --~--~-~--~~~---~--~~ You received this message

Re: Django doesn't like serving a view to Apache

2009-01-21 Thread joshuajonah
I am running this script through shell while ssh'd into the server so its coming from the same source On Jan 21, 3:44 pm, joshuajonah wrote: > The library is for pulling data from MLS. > > I tried running it under the apache user, works fine there. I guess > I'll have to

Re: Django doesn't like serving a view to Apache

2009-01-21 Thread joshuajonah
The library is for pulling data from MLS. I tried running it under the apache user, works fine there. I guess I'll have to dig a little. On Jan 21, 3:39 pm, Colin Bean wrote: > On Wed, Jan 21, 2009 at 12:18 PM, joshuajonah wrote: > > > Why wouldn't it

Re: Django doesn't like serving a view to Apache

2009-01-21 Thread Colin Bean
On Wed, Jan 21, 2009 at 12:18 PM, joshuajonah wrote: > > Why wouldn't it at least except? > > On Jan 21, 3:17 pm, joshuajonah wrote: >> It doesn't even get to start the session:http://dpaste.com/111586/ >> >> On Jan 21, 3:14 pm, joshuajonah

Re: Possible Model Inheritance Issue? Error: [Model_Name] instance needs to have a primary key value before a many-to-many relationship can be used

2009-01-21 Thread Martin Conte Mac Donell
Again, i can't reproduce your problem. It's working using SVN HEAD with your model and this view: http://dpaste.com/111590/. Could you try to use that dict and Student(**mydict) instead of "model_import_info.model_for_import.objects.create" ? Regards, M On Wed, Jan 21, 2009 at 3:06 PM, Keyton

Re: Django doesn't like serving a view to Apache

2009-01-21 Thread joshuajonah
Why wouldn't it at least except? On Jan 21, 3:17 pm, joshuajonah wrote: > It doesn't even get to start the session:http://dpaste.com/111586/ > > On Jan 21, 3:14 pm, joshuajonah wrote: > > > It works and outputs what it

Re: Django doesn't like serving a view to Apache

2009-01-21 Thread joshuajonah
It doesn't even get to start the session: http://dpaste.com/111586/ On Jan 21, 3:14 pm, joshuajonah wrote: > It works and outputs what it should:http://dpaste.com/111584/ > > I'll try commenting out some lines and seeing how far it gets. > > On Jan 21, 3:10 pm, Colin Bean

Re: Django doesn't like serving a view to Apache

2009-01-21 Thread joshuajonah
It works and outputs what it should: http://dpaste.com/111584/ I'll try commenting out some lines and seeing how far it gets. On Jan 21, 3:10 pm, Colin Bean wrote: > On Wed, Jan 21, 2009 at 11:34 AM, joshuajonah wrote: > > > I'm having an issue getting

Re: Django doesn't like serving a view to Apache

2009-01-21 Thread Colin Bean
On Wed, Jan 21, 2009 at 11:34 AM, joshuajonah wrote: > > I'm having an issue getting Apache to serve a view. It appears to work > fine through shell (http://dpaste.com/111549/), however when viewed > through a web browser, it loads indefinitely. > > Here is the view:

Re: move/change database type

2009-01-21 Thread Alistair Marshall
On Jan 21, 7:54 pm, joshuajonah wrote: > A normal manage.py dump to fixture doesn't work? > I had missed that one, didn't know it was an option. my bad Thanks Alistair --~--~-~--~~~---~--~~ You received this message because you are

Re: TypeError: Related Field has invalid lookup: icontains

2009-01-21 Thread Alessandro Ronchi
2009/1/21 Karen Tracey : > On Wed, Jan 21, 2009 at 10:21 AM, Alessandro Ronchi > wrote: >> >> When one tries to make a search in admin with a model table he gets this >> error: >> >> TypeError: Related Field has invalid lookup: icontains >> >> is

Re: httpresponseredirect

2009-01-21 Thread saved...@gmail.com
Hello Malcolm, This is what I get... Traceback: File "C:\Python25\Lib\site-packages\django\core\handlers\base.py" in get_response 86. response = callback(request, *callback_args, **callback_kwargs) File "C:\Python25\Lib\site-packages\Django-1.0\django\languagen\..

Re: httpresponseredirect

2009-01-21 Thread saved...@gmail.com
Hello Malcolm, This is what I get... Traceback: File "C:\Python25\Lib\site-packages\django\core\handlers\base.py" in get_response 86. response = callback(request, *callback_args, **callback_kwargs) File "C:\Python25\Lib\site-packages\Django-1.0\django\languagen\..

Writing your first Django app, part 2 error in using http://127.0.0.1:8000/admin/

2009-01-21 Thread bconnors
in followingWwriting your first Django app, part 2 when I typed in: http://127.0.0.1:8000/admin/ I got: Traceback (most recent call last): File "C:\Python26\Lib\site-packages\django\core\servers \basehttp.py", line 278, in run self.result = application(self.environ, self.start_response)

Re: move/change database type

2009-01-21 Thread joshuajonah
A normal manage.py dump to fixture doesn't work? On Jan 21, 2:44 pm, Alistair Marshall wrote: > Hi folks, > > I have been developing a project on my desktop using sqlite, I have > just attempted to move it onto a 'proper' server and was hoping to use > mysql. > >

Re: Django doesn't like serving a view to Apache

2009-01-21 Thread joshuajonah
Also, this instance of django serves other views fine. On Jan 21, 2:34 pm, joshuajonah wrote: > I'm having an issue getting Apache to serve a view. It appears to work > fine through shell (http://dpaste.com/111549/), however when viewed > through a web browser, it loads

move/change database type

2009-01-21 Thread Alistair Marshall
Hi folks, I have been developing a project on my desktop using sqlite, I have just attempted to move it onto a 'proper' server and was hoping to use mysql. The thing is I have some data in the database from some beta users and was hoping to take the data over with the move. I had planned on

Re: Flatpages

2009-01-21 Thread Adi Sieker
Hi, check this out. http://code.djangoproject.com/ticket/6932 adi On 21.01.2009, at 16:53, Gordon wrote: > > Hi > I've just started to use Django and have been using the flatpages > plugin for serving static pages. Does anyone know how or a plugin that > will generate a content's tree from

Django doesn't like serving a view to Apache

2009-01-21 Thread joshuajonah
I'm having an issue getting Apache to serve a view. It appears to work fine through shell (http://dpaste.com/111549/), however when viewed through a web browser, it loads indefinitely. Here is the view: http://dpaste.com/111551/ Any ideas guys?

Re: I don't even know where to begin writing this template-tags

2009-01-21 Thread Doug B
I went the hideous route, but tried to make it general enough I could reuse. I'm still on .96, but it shouldn't be too much trouble to make it work with 1.0. In [2]: template.Template("{% load kwtag %}{% do_kwtagtest foo foo=bar %}").render(template.Context()) Out[2]: "['foo']{'foo': 'bar'}"

Re: Multiple managers for reverse-links between subclasses

2009-01-21 Thread Mackenzie Kearl
On Jan 21, 11:14 am, Aneurin Price wrote: > (Apologies for the vague subject; I couldn't think how to summarise this :P) > > Hello all, > > I have an application where some models are inherited from others, like so: >    Foo >   /   \ > Bar  Baz > Each object has (or may

Re: httpresponseredirect

2009-01-21 Thread saved...@gmail.com
Let me learn how to crawl before I can walk... Thanks for your time.. Ken On Jan 21, 10:48 am, "saved...@gmail.com" wrote: > Hello Malcolm, > Thanks for your response.  I have thought very carefully before > responding to your email.  In no way was I ignoring your previous >

Re: Ongoing problems with django-registration installation.

2009-01-21 Thread NoviceSortOf
Karen: Thanks again, you are right I had the userprofile installed instead of django-profiles installed. I went to the bitbucket django-registration link you mentioned before and downloaded the django-profiles linked there and installed it. I made a small modification to

Re: problem on django book tutorial

2009-01-21 Thread Karen Tracey
On Wed, Jan 21, 2009 at 1:36 PM, xankya wrote: > > class Admin didnt show "book" on admin interface. instead admin.py in > the books folder show up "book" on admin interface. > > Can anyone conform "class Amin: pass" works ?? > 'class Admin' worked for the level of

problem on django book tutorial

2009-01-21 Thread xankya
class Admin didnt show "book" on admin interface. instead admin.py in the books folder show up "book" on admin interface. Can anyone conform "class Amin: pass" works ?? class Book(models.Model): title = models.CharField(maxlength=100) authors = models.ManyToManyField(Author)

Re: Ongoing problems with django-registration installation.

2009-01-21 Thread Karen Tracey
On Wed, Jan 21, 2009 at 12:22 PM, NoviceSortOf wrote: > > > 0.7 is where full Django 1.0 compatibility was included. I'm assuming > you > > are using Django 1.0 or higher? The error related to 'alnum_re' you > mention > > later looks to be the result of django-registration

Re: Compare the fields of the same model

2009-01-21 Thread Costin Stroie
On Jan 21, 9:27 am, urukay wrote: > Hi > > i would use raw SQL to retrieve models, that would be the fastest way i > quess:http://docs.djangoproject.com/en/dev/topics/db/sql/ > > from django.db import connection > > cursor = connection.cursor() >

Re: I don't even know where to begin writing this template-tags

2009-01-21 Thread Preston Holmes
It may not be as pretty as a parseable param array, but what about just having all your args in a single JSON string. Are your template authors savvy enough? -Preston On Jan 20, 3:32 pm, Andrew Ingram wrote: > I'm building a simple banner/promotion system for a site.

How to Model Formset

2009-01-21 Thread Mackenzie Kearl
The only way to describe what I am trying to accomplish is through an example. Here are my models class B(models.Model): credits = models.FloatField(,null=True) class A(models.Model): b = models.OneToOneField(B) description = models.TextField() I want to get a formset of A forms

Re: Ongoing problems with django-registration installation.

2009-01-21 Thread NoviceSortOf
> 0.7 is where full Django 1.0 compatibility was included.  I'm assuming you > are using Django 1.0 or higher?  The error related to 'alnum_re' you mention > later looks to be the result of django-registration using a core validator > thingy -- these were all removed prior to Django 1.0, so if

Multiple managers for reverse-links between subclasses

2009-01-21 Thread Aneurin Price
(Apologies for the vague subject; I couldn't think how to summarise this :P) Hello all, I have an application where some models are inherited from others, like so: Foo / \ Bar Baz Each object has (or may have) a parent object, which is a Foo (it might be a Bar or a Baz, or some other

Re: Possible Model Inheritance Issue? Error: [Model_Name] instance needs to have a primary key value before a many-to-many relationship can be used

2009-01-21 Thread Keyton Weissinger
I'm on django 1.0.1 (NOT 1.0.2). Do you think that has any impact on this problem? I will try upgrading tonight. Any other ideas? K On Jan 21, 8:33 am, Keyton Weissinger wrote: > More information... > > I stuck the following into my code at the same place the other code is >

Re: Problems with InlineModelAdmin: Date hierarchy?

2009-01-21 Thread Karen Tracey
On Wed, Jan 21, 2009 at 11:36 AM, Benjamin Buch wrote: > I simplified the models a bit for better demonstration. > Thanks. That makes it easier to spot the problem. > Here's the model: > > from django.db import models > > class a(models.Model): > title =

Re: Problems with InlineModelAdmin: Date hierarchy?

2009-01-21 Thread Benjamin Buch
All right, I think I've got it: 1: I tried to use InlineModelAdmin with a ManyToMany-Field. You can do this, but you've got to do it as described here I guess: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#working-with-many-to-many-intermediary-models . 2: I confused the model which

Re: Ongoing problems with django-registration installation.

2009-01-21 Thread Karen Tracey
On Wed, Jan 21, 2009 at 10:06 AM, NoviceSortOf wrote: > > > Initially my problem was getting django-registration to add/update new > users to my > custom designed mysite.UserProfile table. > > Other than that django-registration worked o.k. sent notifications and > so on, > but

Re: Problems with InlineModelAdmin: Date hierarchy?

2009-01-21 Thread Benjamin Buch
I simplified the models a bit for better demonstration. Here's the model: from django.db import models class a(models.Model): title = models.CharField(max_length=50) other_model = models.ManyToManyField('b') def __unicode__(self): return self.title class

Re: Ongoing problems with django-registration installation.

2009-01-21 Thread NoviceSortOf
update to the above - running manage.py syncdb DID create the mysite.myproject.userprofile with all the userprofile.models base fields included. on completion of the registration form though i still get The following error * Request URL:

Re: Problems with InlineModelAdmin: Date hierarchy?

2009-01-21 Thread Karen Tracey
On Wed, Jan 21, 2009 at 10:53 AM, Benjamin Buch wrote: > > Hi, > > I'm trying to use InlineModelAdmins, but get a strange error thrown... > You get this error raised when you do what, exactly? Also the full traceback might provide a clue of what is going on. Karen

Re: TypeError: Related Field has invalid lookup: icontains

2009-01-21 Thread Karen Tracey
On Wed, Jan 21, 2009 at 10:21 AM, Alessandro Ronchi < alessandro.ron...@soasi.com> wrote: > > When one tries to make a search in admin with a model table he gets this > error: > > TypeError: Related Field has invalid lookup: icontains > > is there anyway to solve it and make it returns nothings

Flatpages

2009-01-21 Thread Gordon
Hi I've just started to use Django and have been using the flatpages plugin for serving static pages. Does anyone know how or a plugin that will generate a content's tree from the URLs? e.g. /staff/ /staff/management/ /staff/clerical/ /staff/technical/ /projects/ /projects/ace/ /projects/django/

Problems with InlineModelAdmin: Date hierarchy?

2009-01-21 Thread Benjamin Buch
Hi, I'm trying to use InlineModelAdmins, but get a strange error thrown... Here's admin.py: from mysite.showroom.models import Project, ProjectImage, Client, Service from django.contrib import admin from filebrowser import fb_settings class ProjectImageInline(admin.TabularInline):

Re: httpresponseredirect

2009-01-21 Thread saved...@gmail.com
Hello Malcolm, Thanks for your response. I have thought very carefully before responding to your email. In no way was I ignoring your previous posts, I was trying to take the easy way, rather than the correct way. Furthermore, I really don't know how. I have spent hours trying to look it up,

Best Practices for debugging URL problems

2009-01-21 Thread Adam Nelson
I recently had what is a common issue for many Django developers: "No module named urls" What turned out to be the issue is that I had deleted one of the urls.py files accidentally because I deleted an app that I thought I was no longer being used but was in fact being called by the top level

TypeError: Related Field has invalid lookup: icontains

2009-01-21 Thread Alessandro Ronchi
When one tries to make a search in admin with a model table he gets this error: TypeError: Related Field has invalid lookup: icontains is there anyway to solve it and make it returns nothings instead of 500 error? -- Alessandro Ronchi Skype: aronchi http://www.alessandroronchi.net SOASI

Re: Recommendation on understanding CSS

2009-01-21 Thread Erik S.
On Jan 21, 3:52 am, Gath wrote: > Guys, > > Its seems the best way to do templates in Django is via plain html and > css, but am having a problem in understanding css easily, can someone > recommend some nice material/site on css i can read, i mean step by > step till complex

Re: Pickling a dictionary into a PostgreSQL database?

2009-01-21 Thread Torsten Bronger
Hallöchen! teth writes: > Using str(pickle.dumps()) and the pickle.loads(str()) works > perfectly. Unfortunately, I had to realise that it is not so simple due to . Now it use the following functions: def ascii_pickle(python_object): u"""Converts an

Ongoing problems with django-registration installation.

2009-01-21 Thread NoviceSortOf
Initially my problem was getting django-registration to add/update new users to my custom designed mysite.UserProfile table. Other than that django-registration worked o.k. sent notifications and so on, but without it giving me control of our custom user profile it was impossible to move

Re: ManyToManyField in both models

2009-01-21 Thread Evgeniy Ivanov (powerfox)
Hi, I've returned to the problem and noticed, that recipe described in the docs is a kind of wrong: intermediary model is just a kind of M2M (I mean multiselection) since you have select widgets for inline model and to make real m2m editing have to add more inlines. Custom model can help, but

RESTful PUT request

2009-01-21 Thread junker37
I can't seem to get django to handle a PUT request. I've googled quited a bit and there seems to be some RESTful interfaces available for django, however, I can't seem to get any of them to work because the PUT request gets a 301 direct to a GET request. I created my own middleware where I can

Re: Convert iso-8859-1 queryset to utf-8

2009-01-21 Thread bruno desthuilliers
On 21 jan, 12:55, Anders wrote: > My django site uses iso-8859-1 as default output of all the web pages > (due to ssi intergration with other iso-8859-1 pages). > > So I have set: > DEFAULT_CHARSET = 'iso-8859-1' > FILE_CHARSET = 'iso-8859-1' > > and this works

Admin list exclusions

2009-01-21 Thread django_fo...@codechimp.net
I have a class called Entry that has a one-to-many relationship with itself like: class Entry(models.Model): title = models.CharField(max_length=255) body = models.TextField() author = models.ForeignKey(User) date_published = models.DateTimeField() parent =

Re: AUTH_PROFILE_MODULE confusion

2009-01-21 Thread NoviceSortOf
creecode: we cross posted yesterday. i tried your suggestion about using signal but could not get it to add records to the designated user profile. for now i've reinstalled registration upgrading to .06 as well as the matching userprofile profiles .06 Still am encountering hours of problems

Re: I don't even know where to begin writing this template-tags

2009-01-21 Thread bruno desthuilliers
On 21 jan, 14:17, Puneet Madaan wrote: > try this... its complete tutorial which include template tags too.. will > help you to understand Thanks but as far as I'm concerned, I've written far enough template tags to not have a use for an introductory tutorial to Django's

Re: Possible Model Inheritance Issue? Error: [Model_Name] instance needs to have a primary key value before a many-to-many relationship can be used

2009-01-21 Thread Keyton Weissinger
More information... I stuck the following into my code at the same place the other code is bombing. I did this just to make sure that I wasn't getting anything weird in the dictionary here that I wasn't getting in the command line. mydict = {'city': u'Columbus', 'first_name': u'Miles',

install django on a shared host, with fastcgi

2009-01-21 Thread codediscuss.com
Hello, I'm new to python, apache and django. I'm trying to install django on my shared host (hostmonster). I searched for some tutorials and followed them but no luck. Here is the page I get when I try to visit my site: Not Found The requested URL

Convert iso-8859-1 queryset to utf-8

2009-01-21 Thread Anders
My django site uses iso-8859-1 as default output of all the web pages (due to ssi intergration with other iso-8859-1 pages). So I have set: DEFAULT_CHARSET = 'iso-8859-1' FILE_CHARSET = 'iso-8859-1' and this works fine for alle the pages I serve. But now I have to serve an xml output for use

Re: I don't even know where to begin writing this template-tags

2009-01-21 Thread Puneet Madaan
try this... its complete tutorial which include template tags too.. will help you to understand http://www.webmonkey.com/tutorial/Use_Templates_in_Django greetings, Puneet On Wed, Jan 21, 2009 at 2:13 PM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > > On 21 jan, 00:32, Andrew

Re: Sessions being written twice?

2009-01-21 Thread Iqbal Abdullah
Hi Malcolm, Thank you for the tip! I see now that in my particular code example above, the idea of using session id and manually setting it through the request can only work if the session id itself doesn't change after i've set it into the response. From your explaination, there is no guarantee

Re: Login during registration

2009-01-21 Thread Alastair Campbell
Thanks Bruno, Looks like out emails crossed in the ether! The error message didn't really help, it was failing at the auth stage, which doesn't help debugging. My colleague had to add debug code to Django auth to figure out the issue. I was just surprised that @login_required didn't check for

Re: Possible Model Inheritance Issue? Error: [Model_Name] instance needs to have a primary key value before a many-to-many relationship can be used

2009-01-21 Thread Keyton Weissinger
Oh, and I have printed the import_object_dict, it has exactly what I think it should... Argh! ;-) K On Jan 21, 12:12 am, Martin Conte Mac Donell wrote: > On Wed, Jan 21, 2009 at 2:35 AM, Keyton Weissinger wrote: > > > Oh and just to re-state, this exact

Re: I don't even know where to begin writing this template-tags

2009-01-21 Thread bruno desthuilliers
On 21 jan, 00:32, Andrew Ingram wrote: > I'm building a simple banner/promotion system for a site. Aside from a > few date-related fields, a banner consists of: > - an image > - a target url > - the image dimensions > - some tags (using django-tagging) > > I'm trying to

Re: Possible Model Inheritance Issue? Error: [Model_Name] instance needs to have a primary key value before a many-to-many relationship can be used

2009-01-21 Thread Keyton Weissinger
Hi Martin, Thanks for the suggestion. I've tried it both ways to no avail. All, Here's the code from django.db.models.base.py (in the Model.__init__) where the trouble seems to start (around line 224): # Now we're left with the unprocessed fields that *must* come from #

Re: Q about cache backend for sessions and clustering

2009-01-21 Thread shi shaozhong
Dear Andrew Ingram, What you are doing is very interesting. I am looking into JSON at client side and Python at server side. I am particularly interested in how to access session objects in JSON and Python, so that both sides know the same sessions to handle. I am using Windows IIS. Is there

Re: Login during registration

2009-01-21 Thread bruno desthuilliers
On 21 jan, 00:27, AlastairC wrote: > Hi everyone, > > I'm trying to create a registration process that includes membership > details and a paypal bit (for a non-profit org), and use the > registration app as the first step. > > However, I'd like to log people in when they

Re: Login during registration

2009-01-21 Thread Alastair Campbell
To answer my own question... I got some help at work, and established that the login was failing because it is using the hashed password, not the raw one. That means that there is no way for me to use the activation stage to log the person in (apart from asking them for their details again). I

Re: Normal views and JSON API

2009-01-21 Thread shi shaozhong
Hello, Guyon Moree, What you are doing is very interesting. I am also looking into JSON at client side and Python at server side. I am particularly interested in how to access session objects in JSON and Python, so that both sides know the same sessions to handle. I am using Windows IIS. Is

Re: Django Responses

2009-01-21 Thread bruno desthuilliers
On 20 jan, 23:26, bfrederi wrote: > I have a general question about creating a response in Django. > > If I am creating a response using the return > django.shortcuts.render_to_response function: > > return render_to_response( >     'template_name.html', >    

Re: Sessions being written twice?

2009-01-21 Thread shi shaozhong
Hello. I am using Windows IIS and Python. I am very much interested in how to access session objects, session ids, so that I probably can use session ids to create temporary folders for users. Any concise instructions on this and any demo scripts available for me to understand how to

Re: Sessions being written twice?

2009-01-21 Thread Malcolm Tredinnick
On Wed, 2009-01-21 at 04:11 -0800, Iqbal Abdullah wrote: > Hi guys, > > I need to support some browsers which doesn't handle cookies, so I > have followed the snippet here to manually get session ids from the > request: > http://www.djangosnippets.org/snippets/460/ > > and positioned the new

Re: Recommendation on understanding CSS

2009-01-21 Thread Kenneth Gonsalves
On Wednesday 21 Jan 2009 3:24:22 pm bruno desthuilliers wrote: > The references are on the w3c site - but they are, well, references. A > good starting point for actually learning how to use css is A List > Apart: > > http://alistapart.com/ that is not a starting point - that is nirvana --

Sessions being written twice?

2009-01-21 Thread Iqbal Abdullah
Hi guys, I need to support some browsers which doesn't handle cookies, so I have followed the snippet here to manually get session ids from the request: http://www.djangosnippets.org/snippets/460/ and positioned the new middleware before the SessionMiddleware in the settings.py file. I did an

Re: how may i write Recursion for this

2009-01-21 Thread Praveen
Hi Malcolm Thanks for reply. whatever you said i do agree. I do not have huge dataset. whatevere i have given the records in table (See earlier message of this discussion) that is fixed not going to be expand. as you said i wrote Level3 inside Level2 def latest_listing(request):

Re: Invalid block tag: "get_comment_count"

2009-01-21 Thread Florian Lindner
Am 20.01.2009 um 21:40 schrieb Florian Lindner: > > > Am 19.01.2009 um 22:58 schrieb Briel: > >> >> You should try playing around with the tags, trying to load comments >> different places trying some of the other comment tags to see what >> happens ect. >> Also are you using the block tags?

Re: Normal views and JSON API

2009-01-21 Thread Malcolm Tredinnick
On Wed, 2009-01-21 at 01:32 -0800, Guyon Morée wrote: > Hi, > > I've built a bunch of 'normal' views rendering templates and > processing POST's. > > Now, I'd like to build a API for my site, based on JSON. When building > this API I noticed most of the views are 99% the same, Excellent. :-)

Re: Normal views and JSON API

2009-01-21 Thread Guyon Morée
Malcolm, thank you for the elaborate response, much appreciated! On Jan 21, 10:51 am, Malcolm Tredinnick wrote: > On Wed, 2009-01-21 at 01:32 -0800, Guyon Morée wrote: > > Hi, > > > I've built a bunch of 'normal' views rendering templates and > > processing POST's. >

Re: Recommendation on understanding CSS

2009-01-21 Thread bruno desthuilliers
On 21 jan, 09:52, Gath wrote: > Guys, > > Its seems the best way to do templates in Django is via plain html and > css, but am having a problem in understanding css easily, can someone > recommend some nice material/site on css i can read, i mean step by > step till complex

Re: Shortcut for combining "with...as" and "include" template tags?

2009-01-21 Thread Flo Ledermann
On Jan 21, 10:11 am, Malcolm Tredinnick wrote: > > Coming back from the generalization to my usecase, i cannot see how > > > {% with a as b %} > > {% with x as y %} > > {% include "foo.html" %} > > {% endwith %} > > {% endwith %} > > > is syntactically or semantically

  1   2   >