Problem with generic views in tutorial example

2008-08-21 Thread Rodney Topor
I'm having trouble modifying the tutorial example to use generic views. (My implementation without generic views works fine.) I've registered the class Poll with admin in a separate admin.py module as described in ticket 8181. I've provided names for all url patterns in app polls. I've

Re: numerous problems with the source code in this book

2008-08-21 Thread Ray Smith
Hi, I'm half way through the book (using 1.0 beta). I have made a couple of changes as I went through. What is the current error you have? (Looking back through the archives of django users I believe the author is still working on updated versions of the source code). Regards, Ray Smith

numerous problems with the source code in this book

2008-08-21 Thread texasclimber
I have been trying to learn django through the examples in the Practical Django Projects book, though following the code bit by bit leaves a trail of errors that must be diagnosed item by item which detracts from learning the framework. I have managed to find solutions in the google groups to

Re: error when installing the django-tagging

2008-08-21 Thread Ray
Try looking here: http://code.google.com/p/django-tagging/issues/detail?id=110 On Aug 22, 1:20 pm, Chr1s <[EMAIL PROTECTED]> wrote: > > I got error message like this. > >     raise ImportError("Settings cannot be imported, because > environment variable %s is undefined." % ENVIRONMENT_VARIABLE)

Re: database relationships

2008-08-21 Thread lingrlongr
One more note. You wouldn't NEED to explicitly grab all those vars, as you can get them in a template too. I just wanted to show you the relation. If you sent the track to the template, you can get the artist by using: {{ track.album.artist }} Keith On Aug 22, 12:24 am, lingrlongr <[EMAIL

Re: database relationships

2008-08-21 Thread lingrlongr
The only part you have that is redundant is the "artist" in your "Track" class. You can find out the artist because a track is related to an album, which in turn, is related to an artist. Some of the code you'd maybe see in a view would be: # views.py from django.shortcuts import

database relationships

2008-08-21 Thread nek4life
I'm trying to set up my first Django application and I'm trying to figure out the database relationships. I want to be able to list albums, with their corresponding tracks and album artwork. Right now I only have foreign keys defined in the Track class and on the AlbumArt class pointing to the

error when installing the django-tagging

2008-08-21 Thread Chr1s
Hi all, I am writing a project on django, everything is fine, acutally I have finished few apps already. btw I am using django itself to debug and act as web-server. I got the develop version of django and django-tagging. when I try to install django-tagging as the command sudo python setup.py

Re: Text Parsing Question

2008-08-21 Thread Garrett Garcia
On Thu, Aug 21, 2008 at 6:15 PM, Tim Chase <[EMAIL PROTECTED]>wrote: > > > So i'm working on a view that will need to parse character > > strings that will have a predictable structure, but dynamic > > content. The format will look like > > "%Zxx^xx?;xx? where all

Re: Init Parameter Trouble

2008-08-21 Thread Robert
Sure, it's: [code from quizmodo.base.forms import ClassEventForm class StackForm(ClassEventForm): name = forms.CharField(max_length=100) description = forms.CharField(widget=forms.Textarea) anonymous = forms.BooleanField(required=False) private = forms.BooleanField(required=False)

Re: import of mysql in settings.py

2008-08-21 Thread Ian Holsman
Cortland Klein wrote: > I just had the same problem. It has something to do with MySQLdb not > being included. > > when it rain's it pours. I'm been hitting my head on the same problem. to verify that this is the case just replace 'mysql' with 'dummy' and you should be able to validate the

Re: Upload image in own form

2008-08-21 Thread Robvdl
Thank you very much, this worked perfectly. --~--~-~--~~~---~--~~ 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,

Re: Text Parsing Question

2008-08-21 Thread Tim Chase
> So i'm working on a view that will need to parse character > strings that will have a predictable structure, but dynamic > content. The format will look like > "%Zxx^xx?;xx? where all x are > the unpredictable characters and all the rest will be present >

Re: Text Parsing Question

2008-08-21 Thread [EMAIL PROTECTED]
For your first question, split should work. For your second, foo=original_string[:4] (You're slicing it) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

djangobook embed comments

2008-08-21 Thread aleray
Hi, I'm looking for the source code used for the the djangobook, using embed comments (the possibility of commenting each paragraph), or I'm looking for clues for how to do this. Best ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: 500.shtml

2008-08-21 Thread Ronaldo Z. Afonso
Hi Erik, I'm using a shared host with fast-cgi ... I don´t know if I have a log ... I'll ask my hosting service provider. On Fri, 2008-08-22 at 03:24 +0300, Erik Allik wrote: > Did you check the web server log? If you're using the built in server, > just look at the console output it

Re: 500.shtml

2008-08-21 Thread Erik Allik
Did you check the web server log? If you're using the built in server, just look at the console output it produces. Because we can't help you with the information you provided. Erik On 22.08.2008, at 3:05, Ronaldo Z. Afonso wrote: > > Hi all, > > This is my first post to this list. I'm

Text Parsing Question

2008-08-21 Thread Robocop
So i'm working on a view that will need to parse character strings that will have a predictable structure, but dynamic content. The format will look like "%Zxx^xx?;xx? where all x are the unpredictable characters and all the rest will be present in EVERY string,

500.shtml

2008-08-21 Thread Ronaldo Z. Afonso
Hi all, This is my first post to this list. I'm trying to access an Admin page and I'm being redirected to a 500.shtml page. Does anyone know what could be happening? I'm using Django version 1.0.beta_1. Thanks in advance ... Ronaldo. --~--~-~--~~~---~--~~ You

Re: InlineModelAdmin min_num ?

2008-08-21 Thread mike
I'm thinking more of something in the ModelAdmin classes to replace min_num_in_admin that I'm using as an argument in models.ForeignKey() On Aug 19, 12:36 am, Peter of the Norse <[EMAIL PROTECTED]> wrote: > Perhaps you’re thinking of `extra`? > > On Aug 13, 2008, at 9:24 PM, mike wrote: > > >

Re: import of mysql in settings.py

2008-08-21 Thread Cortland Klein
I just had the same problem. It has something to do with MySQLdb not being included. For me, I think it's because Mac OS X 10.5.4 doesn't have this python thing installed. The documentation and tutorial should mention this, IMO. http://code.djangoproject.com/ticket/5531#comment:12 On Aug

import of mysql in settings.py

2008-08-21 Thread mpls
I've edited the DATABASE_ENGINE = 'mysql' in settings.py along with specifying a database name and user account info. But I get the following error: ImportError: No module named mysql.base How can I fix this problem. Any help is appreciated.

formset validation

2008-08-21 Thread mg
I am trying to validate a formset that I have and am having problems with the forms within the set. If i call is_valid on a formset after a POST, it seems that the individual forms aren't validating within the set. For example, if the code below is executed, the resulting log looks like this:

Re: How to know which fields a model contains?

2008-08-21 Thread jason
You could use this: Publisher.objects.get(pk=1).__dict__ The admin application is also great for this! :) Best Regards, Jesaja Everling On Aug 21, 10:55 pm, Erik Allik <[EMAIL PROTECTED]> wrote: > Do you mean something like Publisher._meta.fields? > > Erik > > On 21.08.2008, at 22:38, Alexis

Re: simple python question

2008-08-21 Thread Thomas Kerpe
results.append({'URL': '/feed/%s/show/%s' % (item.rss, item.rssfeed),}) On Thu, Aug 21, 2008 at 23:29, Bobby Roberts <[EMAIL PROTECTED]> wrote: > > hi. > > I'm trying to figure out how to dynamically replace things in a string > as follows: > > >results.append({'URL': '/feed/%s/show/%s'

simple python question

2008-08-21 Thread Bobby Roberts
hi. I'm trying to figure out how to dynamically replace things in a string as follows: results.append({'URL': '/feed/%s/show/%s' (%item.rss, %item.rssfeed),}) I think i'm close but it's not the right syntax. can anyone out there help?

Re: newbie urls.py question

2008-08-21 Thread jason
This is probably due to the module pinax being on the pyhton-path. This way you don't have to import it. You can edit the path from python like so: import sys sys.path.insert(0, "/path/to/package") If you install a package using setup.py or setuptools or some other automatic mechanism, it is

Re: How to know which fields a model contains?

2008-08-21 Thread Erik Allik
Do you mean something like Publisher._meta.fields? Erik On 21.08.2008, at 22:38, Alexis Bellido wrote: > > Hello, I'm reading the Django book and after reviewing the database > API I was wondering if there was some method to find out which fields > a model contains. > > For example, if I have

Re: formset and __init__

2008-08-21 Thread patrickk
well, to me this is very common - I need to edit __init__ for about 50% of the forms I´ve used so far (and I´ve used quite a lot of forms). I guess that a lot of people will be glad to have "modelforms", but I doubt that they can be used in real-world- applications. and ... it´s ok, if django

Re: How to filter FOO_set in templates?

2008-08-21 Thread Garrett Garcia
On Wed, Aug 20, 2008 at 11:17 PM, Benjamin Buch <[EMAIL PROTECTED]> wrote: > > > Hi Garret, > > > How about sending the template something like: > > > > songs = Recording.objects.filter(represents_song=True) > > > > A custom manager seems like overkill for this situation (If I'm > > understanding

Re: How to know which fields a model contains?

2008-08-21 Thread [EMAIL PROTECTED]
On Aug 21, 2:38 pm, Alexis Bellido <[EMAIL PROTECTED]> wrote: > Hello, I'm reading the Django book and after reviewing the database > API I was wondering if there was some method to find out which fields > a model contains. If I'm understanding the question, why not just use the documentation

A little hack for collapsing apps in the admin

2008-08-21 Thread [EMAIL PROTECTED]
I've always put the most important apps up top in the admin, and less- used stuff down toward the bottom. As far as I can tell, newforms- admin insists on alphabetizing them, so it occurred to me it would be nice to collapse the less-used apps to keep them out of the way. So, after taking a

How to know which fields a model contains?

2008-08-21 Thread Alexis Bellido
Hello, I'm reading the Django book and after reviewing the database API I was wondering if there was some method to find out which fields a model contains. For example, if I have a Publisher model (which translates to a publisher table in the database) I'm looking for some method in Django

Finding out the name of the named url used

2008-08-21 Thread 7timesTom
I have general processing to do in my context processor based on which url was used. How can find out the name of the url used eg in my middleware. I feel like I want to do: def process_view(self, request, view_func, view_args, view_kwargs): request.url_name = view_kwargs.get('name',

AttributeError - Accessing form attribute

2008-08-21 Thread andmart
Hi, I´m working with django 0.96.2 and have a form called LoginForm as below: #file formularios.py from django import newforms as forms class LoginForm(forms.Form): email = forms.CharField(max_length=100 ) senha = forms.CharField(widget = forms.widgets.PasswordInput) url_back =

Re: newbie urls.py question

2008-08-21 Thread ViX
That seems not the case, eg. http://code.google.com/p/django-hotclub/source/browse/trunk/pinax/urls.py I don't see anything like from pinax import * But it is doing: (r'^about/', include('about.urls')), instead of : (r'^about/', include('pinax.about.urls')), Best, V On Aug 21, 1:20 pm,

wsgi in django for hgwebproxy

2008-08-21 Thread Faheem Mitha
Hello everyone, The version control system mercurial (hg) has some functionality to allow its repositories to be viewed via the web. However, it does not have a builtin authentication system. I'm trying to get a setup working where I can put Django in front. Jesper Noehr of bitbucket.org

Re: formset and __init__

2008-08-21 Thread Justin Fagnani
Looks like you're almost there. You fixed a couple of problems in the code I posted. Can you post more of the error so we know which __init__ is thowing the exception? I know it seems complicated, but I'd be surprised if this pattern was common. I doubt most Form subclasses require extra

Re: How to set queryset on the second step of a form wizard?

2008-08-21 Thread Rajesh Dhawan
On Aug 21, 11:56 am, rr <[EMAIL PROTECTED]> wrote: > The url is herehttp://dpaste.com/72961/ I don't see anything glaringly wrong. You mentioned that it "complains about 'ChannelTypeForm' object has no attribute 'cleaned_data'"...can you dpaste that error trace as well?

Re: lighttpd + fcgi + FORCE_SCRIPT_NAME = admin grief

2008-08-21 Thread Nick
Hi Malcolm, Great; James' suggestion does work perfectly (stupidly obvious; it was of course the one thing I hadn't tried) as suggested. If you're trying to figure out how I got to this recipe I blindly followed the instructions here:

Re: Pre-populating an integer field with a count of model objects

2008-08-21 Thread Brandon Taylor
Hi Daniel, Thanks for the reply. I'll just go with overriding the save. Cheers, Brandon On Aug 21, 11:29 am, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Aug 21, 4:42 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote: > > > Hi everyone, > > > I have a column, 'position', which is a

Field with RadioSelect widget instead of Select widget

2008-08-21 Thread Bela Hausmann
Hi! I'd like to use the RadioSelect widget for some of my model fields with choices. But django always uses Select and if I change it manually in the form class, than I have to specify the choices again and if it's optional or not. So thats not very DRY?! Anyway to do this the right way?

Re: newbie urls.py question

2008-08-21 Thread Jonathan Nelson
Look at the import statements on the different urls.py files. This: from myproject.myapp import myview urlpatterns = patterns('', (r'^somepattern/', myview)) Does the same thing as this: urlpatterns = patterns('', (r'^somepattern/', myproject.myapp.myview)) On Aug 21,

Re: lighttpd + fcgi + FORCE_SCRIPT_NAME = admin grief

2008-08-21 Thread Malcolm Tredinnick
On Thu, 2008-08-21 at 10:02 -0700, James Matthews wrote: > Try FORCE_SCRIPT_NAME="" I use it and it works nicely It's always interesting after landing a feature like this that has a few edge cases to see where the problems distribute themselves. Turns out there are a lot of people using the

Re: Python - ImportError: libclntsh.so.10.1: cannot open shared object file

2008-08-21 Thread James Matthews
Hi, First go to ./manage.py shell and try the same thing "import djproject.daily_source". If it works there it means it's not a django issue and your server is stripping out this lib (Suexec) James On Thu, Aug 21, 2008 at 1:38 AM, 杨明 <[EMAIL PROTECTED]> wrote: > > I got this wrong message: >

Re: lighttpd + fcgi + FORCE_SCRIPT_NAME = admin grief

2008-08-21 Thread James Matthews
Try FORCE_SCRIPT_NAME="" I use it and it works nicely James On Thu, Aug 21, 2008 at 9:00 AM, Nick Clarey <[EMAIL PROTECTED]>wrote: > > Hi all, > > I've been getting my site ported over to 1.0 beta and ran into a > problem. Basically everything works fine when I follow the > instructions

Re: problems with request.user

2008-08-21 Thread Burr Settles
When the IntegrityError is thrown, the debug package stated that "songs_rating.user_id may not be NULL". It is indeed being thrown by get_or_create(). Strangely enough, request.user.id contains the correct value of the logged in user's ID, so I don't know what the problem is. I did manage to get

Re: auto urls for methods

2008-08-21 Thread Erik Allik
http://dpaste.com/72986/ Although I wouldn't recommend this approach in general. This doesn't actually make things simpler, just more complicated. I didn't test this code either, but assuming you won't actually use this, it doesn't matter. Erik On 21.08.2008, at 13:00, James Bennett

Accessing related object id's in custom edit_inline_tabular template

2008-08-21 Thread Rowan Kerr
I'm trying to access the id's of related objects that are edited inline (tabular layout), but not having much luck. Have tried fcw.related_object.id, fcw.obj.id, fcw.obj.original.id, fcw.fields.id, and so on... Any hints on how to properly access that value would be much appreciated! Thanks.

Re: Pre-populating an integer field with a count of model objects

2008-08-21 Thread Daniel Roseman
On Aug 21, 4:42 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I have a column, 'position', which is a PositiveIntegerField, to allow > my end-user to order records with. I would like to pre-populate the > field when creating a new record, with the count of the model objects > +

lighttpd + fcgi + FORCE_SCRIPT_NAME = admin grief

2008-08-21 Thread Nick Clarey
Hi all, I've been getting my site ported over to 1.0 beta and ran into a problem. Basically everything works fine when I follow the instructions except logging into the admin site. The source for the admin login page shows that the login form submits data to "//admin/"; Which is obviously not

Re: How to set queryset on the second step of a form wizard?

2008-08-21 Thread rr
The url is here http://dpaste.com/72961/ -r On Aug 21, 9:39 am, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > On Aug 21, 2:06 am, rr <[EMAIL PROTECTED]> wrote: > > > sorry for being annoying > > > It doesn't work, complains about > > 'ChannelTypeForm' object has no attribute 'cleaned_data' > >

newbie urls.py question

2008-08-21 Thread ViX
I saw some django projects have the site urls.py urlpatterns = patterns('', (r'^app/', include('apps.urls')), ) instead of the regular one: urlpatterns = patterns('', (r'^app/', include('mysite.apps.urls')), ) What need to be setup to achieve this? I trid to look into the site

Pre-populating an integer field with a count of model objects

2008-08-21 Thread Brandon Taylor
Hi everyone, I have a column, 'position', which is a PositiveIntegerField, to allow my end-user to order records with. I would like to pre-populate the field when creating a new record, with the count of the model objects + 1. The models documentation says 'default' can be a value or a

Re: mas sobre unicodedecode erros RESUELTO!

2008-08-21 Thread Jeff Anderson
anonymous wrote: Sin DATABASE_OPTIONS se resuelve el problema en mysql!! Muchas Gracias! De nada. Como dijo Karen, casi no necesita DATABASE_OPTIONS en settings.py. Cuando se usa DATABASE_OPTIONS, solo hay que specificar el tipo del database engine y no mas. Es posible que hay otros

Re: Help needed: too complex for me

2008-08-21 Thread Norman Harman
space0x42 wrote: > Hi all hi, I bet your getting an error since the labels property has no "setter" only a getter and you are trying to assign to it. I'd probably try to rewrite the models with proper model fields instead of that label. But, might not be an option nor good option for someone

Announcing pytagram

2008-08-21 Thread Giuliani Vito Ivan
Hi, I recently started a little project named pytagram (http:// code.google.com/p/pytagram/) that is aimed to generate a toc-like SVG file for mainly python projects. I did this especially for django, since it has A LOT of functions sparse in various namespaces and, although I know what a certain

Re: Init Parameter Trouble

2008-08-21 Thread Norman Harman
Robert wrote: > Hello all, Can we see your view code please? -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ It's August! Keep your cool with the Statesman. Check out our hot deals in print

Re: Reverse URL Questions

2008-08-21 Thread Norman Harman
On Thu, Aug 21, 2008 at 1:50 AM, Rodney Topor <[EMAIL PROTECTED]> wrote: > Second: Doesn't the use of get_absolute_url() somehow violate the > separation of URLs from models? I think so. I have found named urls http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns url

Re: Audit Trail

2008-08-21 Thread Sérgio Durand
Hi Erick, It was working on r8339. I've updated django this morning to r8460 to and still working !! What is "history Manager" that you said ? look how i'm using audit trail: 1) i have my 'ordinary' model (without audit trail feature) 2) i get the audit trail code and drop it into

Re: how to locate the OS currently logged in user??

2008-08-21 Thread Guillaume Lederrey
2008/8/21 PeteDK <[EMAIL PROTECTED]>: > > > > On 21 Aug., 13:10, "Guillaume Lederrey" <[EMAIL PROTECTED]> > wrote: >> 2008/8/21 PeteDK <[EMAIL PROTECTED]>: >> >> >> >> > The server is running Debian Linux and they are logging on to the >> > server using the username and password stored in the

Re: Reverse URL Questions

2008-08-21 Thread Rodney Topor
On Aug 21, 5:25 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > good stuff Thanks very much for the good explanation. > > Third: If one is to reverse map views to URLs, which is the best way > > to do it (if there is a best way)? > > Clarify what you mean by this? Well, perhaps I was

Re: How to set queryset on the second step of a form wizard?

2008-08-21 Thread [EMAIL PROTECTED]
Override the process_step method do that when step one is being processed, it creates the queryset to be used by step 2 then. if(step==1): if(form.is_valid()): self.step2_queryset=Book.objects.filter(**form.cleaned_data) elif(step==0): self.step2_queryset=None Then, override the

Re: Django-survey fails with beta-1

2008-08-21 Thread [EMAIL PROTECTED]
On Aug 20, 8:59 pm, rex <[EMAIL PROTECTED]> wrote: > I commented out the problematic image > code in the file that was causing the problem, and also in > forms.py, and it works. You can leave the ImageField, just remove core=True from it. That's what's throwing the error, and you don't need it

Re: how to locate the OS currently logged in user??

2008-08-21 Thread PeteDK
On 21 Aug., 13:10, "Guillaume Lederrey" <[EMAIL PROTECTED]> wrote: > 2008/8/21 PeteDK <[EMAIL PROTECTED]>: > > > > > The server is running Debian Linux and they are logging on to the > > server using the username and password stored in the active directory > > on one of the other servers. > >

TypeError: __init__() got an unexpected keyword argument 'debug'

2008-08-21 Thread leo
I am getting the following error while starting fcgi process for my django application. Did any one face this problem before? = Traceback (most recent call last): File "./dispatch.fcgi", line 15, in ? runfastcgi(method="threaded", daemonize="false") File

Re: formset and __init__

2008-08-21 Thread patrickk
hehe :-) doesn´t work when data is posted: if request.method == 'POST': formset = UploadFormSet(path_server=PATH_SERVER, path=path, request.POST, request.FILES) error: __init__() got multiple values for keyword argument 'path' On Aug 21, 2:55 pm, patrickk <[EMAIL PROTECTED]>

Re: How to set queryset on the second step of a form wizard?

2008-08-21 Thread Rajesh Dhawan
On Aug 21, 2:06 am, rr <[EMAIL PROTECTED]> wrote: > sorry for being annoying > > It doesn't work, complains about > 'ChannelTypeForm' object has no attribute 'cleaned_data' > when submit on the second step(step1)http://dpaste.com/72840/ Can you also dpaste your URLs.py that shows which form is

Re: Browser timeout on long processes - A partial solution

2008-08-21 Thread Donn
I spent some time fiddling and have a basic jquery/ajax solution to this. I still don't know how to 'backround' a process, but this will allow a progress report to be pulled from Django while another view function is busy. http://www.djangosnippets.org/snippets/994/ hth, \d

Re: formset and __init__

2008-08-21 Thread patrickk
got it - passing parameters to formsets. this is just my personal opinion, but in my view it´s overly complicated for such a common thing ... I thought newforms will make things easier (but that was about 4 weeks ago). class BaseUploadFormSet(BaseFormSet): def __init__(self,

Re: formset and __init__

2008-08-21 Thread patrickk
hmm, this is getting funny ... def _construct_forms(self): # instantiate all the forms and put them in self.forms self.forms = [] for i in xrange(self._total_form_count): self.forms.append(self._construct_form(i)) print self.forms def

Re: how to locate the OS currently logged in user??

2008-08-21 Thread PeteDK
On 21 Aug., 13:44, "Emily Rodgers" <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: django-users@googlegroups.com > > [mailto:[EMAIL PROTECTED] On Behalf Of PeteDK > > Sent: 21 August 2008 11:14 > > To: Django users > > Subject: Re: how to locate the OS currently logged in

list_filter by backward related model

2008-08-21 Thread anonymous
Say I have: class A(models.Model): ... class B(models.Model): a = models.ForeignKey(A, unique=True) ... I would like to show B field in A list_filter. I've successfull show A fields in B list_filter with this patch: http://code.djangoproject.com/ticket/3400 As I can't show a field

RE: how to locate the OS currently logged in user??

2008-08-21 Thread Emily Rodgers
> -Original Message- > From: django-users@googlegroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of PeteDK > Sent: 21 August 2008 11:14 > To: Django users > Subject: Re: how to locate the OS currently logged in user?? > > > > Have you tested the suggestion above with someone who is

Re: formset and __init__

2008-08-21 Thread patrickk
to be more precise: when I do "print form" in formsets.py in line 96, at the end of _construct_form, the form is there. but when trying to display the form(s) in the template, the formset is empty ... On Aug 21, 12:19 pm, patrickk <[EMAIL PROTECTED]> wrote: > thanks justin. > > I´m able to pass

Re: polymorphism and abstract classes

2008-08-21 Thread Kip Parker
Though I'm not sure what MTI is (Google suggest "Massage Training Institute", but that can't be right), what you're trying to do seems well within Django's capabilities. Generic relations allow you to create foreign keys to any other object, so you'd have a Generic Foreign Key in your enclosure,

Re: how to locate the OS currently logged in user??

2008-08-21 Thread Guillaume Lederrey
2008/8/21 PeteDK <[EMAIL PROTECTED]>: > > The server is running Debian Linux and they are logging on to the > server using the username and password stored in the active directory > on one of the other servers. I'm still not clear on how your user log into the server. Via SSH, HTTP Auth, other ?

Re: simple form question

2008-08-21 Thread patrickk
you could use modelforms, see http://www.djangoproject.com/documentation/modelforms/ or without modelforms: class MyForm(forms.Form): def __init__(self, user, *args, **kwargs): self.user = user super(MyForm, self).__init__(*args, **kwargs) ... define your fields

Re: simple form question

2008-08-21 Thread Genis Pujol Hamelink
Thanks for your reply, save() got an unexpected keyword argument 'commit' as I didn't define commit in my save function... where did u get this commit=False from? Grtz, G. On Thu, Aug 21, 2008 at 12:41 PM, patrickk <[EMAIL PROTECTED]> wrote: > > try this: > form.save(commit=False) >

Re: simple form question

2008-08-21 Thread patrickk
try this: form.save(commit=False) form.autor = request.user form.save() On Aug 21, 12:24 pm, "Genis Pujol Hamelink" <[EMAIL PROTECTED]> wrote: > Hello, > > I'm trying to pass a the id of the user logged in to a form field, but it > doesn't seem to work... any ideas / suggestions? > > Thanks in

Re: fcgi - Problem using daemonize=true

2008-08-21 Thread Paddy Joy
Thank you Scott I would have never figured that ou! python manage.py runfcgi daemonize=true method=threaded host=127.0.0.1 port=3033 pidfile=/tmp/django.pid works ok. Paddy On Aug 21, 8:10 pm, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > Paddy, I can't remember all the details of my fcgi

simple form question

2008-08-21 Thread Genis Pujol Hamelink
Hello, I'm trying to pass a the id of the user logged in to a form field, but it doesn't seem to work... any ideas / suggestions? Thanks in advance :) Here are the view, model and form objects: View: def punts_form3(request): if request.method == 'POST': form =

Re: formset and __init__

2008-08-21 Thread patrickk
thanks justin. I´m able to pass the paramters to the form now. unfortunately, the form (in the template) is empty now ... no fields at all, so I guess there´s something missing here (but I don´t know what). On Aug 21, 11:34 am, "Justin Fagnani" <[EMAIL PROTECTED]> wrote: > On Thu, Aug 21, 2008

Re: how to locate the OS currently logged in user??

2008-08-21 Thread PeteDK
> Have you tested the suggestion above with someone who is not sshed into > the box, because if it is just the remote user of the app you want, you > really don't want to be doing '/usr/bin/ who' because that will return > the users sshed onto the box (and *not* the users logged into the web >

Re: fcgi - Problem using daemonize=true

2008-08-21 Thread Scott Moonen
Paddy, I can't remember all the details of my fcgi testing, but I think I saw the same mysterious behavior when I specified a relative path for the pid file. Once I specified an absolute path things seemed to work ok. I may be misremembering, or this may not be your problem. But it's worth a

Re: auto urls for methods

2008-08-21 Thread James Bennett
On Thu, Aug 21, 2008 at 4:51 AM, Will Rocisky <[EMAIL PROTECTED]> wrote: > Is it possible (like Rails) to not to enter every method and it's url > everytime? And url should go to the method straight unless defined. No. 1. Python's general philosophy is that it's best to explicitly say what you

Re: problems with request.user

2008-08-21 Thread Genis Pujol Hamelink
Hello, I think it's with request.session['_auth_user_id'], but not sure gr, G. On Wed, Aug 20, 2008 at 11:13 PM, Burr Settles <[EMAIL PROTECTED]>wrote: > > I recently came back to a project I put on hold for a couple weeks, > and after updating the Django trunk, all my references to >

auto urls for methods

2008-08-21 Thread Will Rocisky
Is it possible (like Rails) to not to enter every method and it's url everytime? And url should go to the method straight unless defined. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

fcgi - Problem using daemonize=true

2008-08-21 Thread Paddy Joy
I'm not sure what's going on here, can anyone help? When I run the following command: python manage.py runfcgi daemonize=false method=threaded host=127.0.0.1 port=3033 pidfile=django.pid everything works fine. The file django.pid is created and I can access my django app through an apache

Re: how to locate the OS currently logged in user??

2008-08-21 Thread PeteDK
On 21 Aug., 01:59, "Garrett Garcia" <[EMAIL PROTECTED]> wrote: > On Wed, Aug 20, 2008 at 9:53 AM, PeteDK <[EMAIL PROTECTED]> wrote: > > > On 20 Aug., 17:56, "Emily Rodgers" <[EMAIL PROTECTED]> wrote: > > > > -Original Message- > > > > From: django-users@googlegroups.com > > > >

Re: formset and __init__

2008-08-21 Thread Justin Fagnani
On Thu, Aug 21, 2008 at 12:30 AM, patrickk <[EMAIL PROTECTED]> wrote: > > I´m not sure (anymore) we´re all talking about the same issue. I think we are. I'll see if I can clarify... The broad idea is that you pass the parameters to the formset in your view via an overridden __init__(), then you

ANN: django-morsels

2008-08-21 Thread Itai Tavor
At first glance (and, quite possibly, second and third) django-morsels might look like a clone of django-chunks (http://code.google.com/p/django-chunks/ ). Both apps attempt to solve the same problem, and in fact, I wrote this app after seeing and trying out django-chunks (so thanks, Clint

RE: how to locate the OS currently logged in user??

2008-08-21 Thread Emily Rodgers
> -Original Message- > From: django-users@googlegroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of PeteDK > Sent: 20 August 2008 17:54 > To: Django users > Subject: Re: how to locate the OS currently logged in user?? > > > > > On 20 Aug., 17:56, "Emily Rodgers" <[EMAIL

ANN: django-farstyle (updated)

2008-08-21 Thread Itai Tavor
The problem of optimizing delivery of css and javascript assets seems to get a fair amount of attention - there are 3 django apps I know of (django-assetpackager, django-compress and my old django-farstyle) and numerous templatetags and related code on django-snippets. The old farstyle

Python - ImportError: libclntsh.so.10.1: cannot open shared object file

2008-08-21 Thread 杨明
I got this wrong message: Could not import djproject.daily_source. Error was: libclntsh.so.10.1: cannot open shared object file: No such file or directory How can I fix the problem? Any help would be appreciated, --~--~-~--~~~---~--~~ You received this message

Re: user defined ordering + admin?

2008-08-21 Thread Matthias Kestenholz
Hi, On Thu, Aug 21, 2008 at 12:40 AM, Bram de Jong <[EMAIL PROTECTED]> wrote: > > Hello All, > > > Has anyone done any work on letting the user define a custom sort > order for objects in "nfa"? > I.e. for example extending a base-class that has a single "order" > integer field and up() and

Re: UnicodeDecodeError and mysql SOLVED!

2008-08-21 Thread anonymous
On Aug 20, 4:05 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > Also most of these settings in DATABASE_OPTIONS are unnecessary. The only > one that you really need if it is not your database default storage engine > is "SET storage_engine=InnoDB". I've eliminate DATABASE_OPTIONS and this

Re: mas sobre unicodedecode erros RESUELTO!

2008-08-21 Thread anonymous
On Aug 20, 8:05 pm, Jeff Anderson <[EMAIL PROTECTED]> wrote: > anonymous wrote: > > Hola, > > > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position > > 6: ordinal not in range(128) > > > > ¿Cómo podría resolverlo? > > > La versión de django es svn trunk y la de Mysql es la  5.

Re: UnicodeDecodeError and mysql

2008-08-21 Thread anonymous
I've tested the application with sqlite instead of mysql and I've no problems. The mysql table that syncdb generate is (the mysql dump): DROP TABLE IF EXISTS `demo_mymodel`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; CREATE TABLE `demo_mymodel` ( `id`

Re: Reverse URL Questions

2008-08-21 Thread James Bennett
On Thu, Aug 21, 2008 at 1:50 AM, Rodney Topor <[EMAIL PROTECTED]> wrote: > So: Why is the use of explicit URLs discouraged, especially in > templates? Why is it better to write {% url > project_name.app_name.views.results %} in a template than to write / > results/ (assuming the URLconf maps

  1   2   >