Re: User attribute access from within profile model

2009-05-18 Thread Sam Chuparkoff
On Mon, 2009-05-18 at 17:12 -0700, neri...@gmail.com wrote: > I have an Employee profile associated with Users who are staff, how do > I return the associated user attributes from within the profile model > i.e., 'full_name' from Users? Anytime I try to access the User > attributes from within

Re: RequiredIfOtherFieldEquals error

2009-05-18 Thread Sam Chuparkoff
On Mon, 2009-05-18 at 01:03 -0700, Christian Martín Reinhold wrote: > Hello I am kind of new with django and I am trying to adapt a piece of > code to the 1.0 version. > > datetime = models.DateTimeField(blank=True, null=True, > validator_list=[RequiredIfOtherFieldEquals('status',

Re: Does a django social sharing widget app exist?

2009-05-18 Thread Sam Chuparkoff
On Sun, 2009-05-17 at 22:47 -0700, Aaron Maxwell wrote: > If this exists, google doesn't seem to know about it. I haven't looked at this, but here's a link: http://tylerlesmann.com/2009/mar/09/announcing-django-sociable/ sdc --~--~-~--~~~---~--~~ You received

ForeignKeyRawId widget contains incorrect link when you click on search gif?

2009-05-18 Thread Margie
I tried using raw_id_fields in admin for the first time (using the Django 1.1 beta). When I click search gif I find that it tries to redirect me to: http://mysite.com/auth/user/?t=id Seems to me it should be redirecting me to this instead (note addition of admin):

Re: MultiValueField with required=True problem

2009-05-18 Thread Thierry
Isn't required the default behaviour of Field: http://docs.djangoproject.com/en/dev/ref/forms/fields/ From the above code, TextInput is required: forms.TextInput(), On May 18, 1:15 pm, "[CPR]-AL.exe" wrote: > class CheckboxSelectWithTextInputWidget(forms.MultiWidget): >

Re: Dojo widgets inside Django

2009-05-18 Thread Guri
On May 19, 12:27 am, Alex Gaynor wrote: > On Mon, May 18, 2009 at 2:04 PM, Guri wrote: > > > Hi, > >          Is there are way to use Dojo widgets inside Django forms.py? > > > Any package, pointers or procedure will help. > > > Thanks In Advance >

Re: How to save the data from a form to my db.

2009-05-18 Thread Thierry
Check this example, but they are using a customized form for models: http://www.djangobook.com/en/2.0/chapter14/#cn176 If your form is not derived from your model, you'll want to explicitly create the model object: def yourview(request): if request.method == 'POST': form =

Question: What's the best way to denormalize M2M data?

2009-05-18 Thread palewire
I've stumbled my way into methods for automatically denormalizing ForeignKey data -- and now see that better approaches have been packaged up the very cool django-denorm (http://code.google.com/p/ django-denorm/) -- which is great. But I'm curious to ask smarter people than myself about best

Re: Many-to-one relations on the "one" side admin form

2009-05-18 Thread Alex Gaynor
On Mon, May 18, 2009 at 10:12 PM, Diogo Baeder wrote: > Hi, guys, > > Is there any way to put a repeatable field (say, many phones) in an admin > form (say, a person)? This way a Person could be related to many Phones, but > these phones could be inserted right in the

Many-to-one relations on the "one" side admin form

2009-05-18 Thread Diogo Baeder
Hi, guys, Is there any way to put a repeatable field (say, many phones) in an admin form (say, a person)? This way a Person could be related to many Phones, but these phones could be inserted right in the Person form... is it possible? Thanks! __ Diogo Baeder

Separate User namespace

2009-05-18 Thread Timboy
I have a normal User model for our private users of our project we also have a UserProfile for those users. We need to have a public portion of our site as well with a separate user namespace. Please advise the best way to achieve our goal. TIA

Re: how to identify if fix for ticket 7028 is in trunk?

2009-05-18 Thread Margie
Thanks so much, Karen - that was very helpful and now I get it. Previously I didn't understand that those attachments were just proposed fixes and a method for communicating the proposed fixes. It all makes sense now. Pretty cool - actually. Margie On May 18, 5:54 pm, Karen Tracey

Re: how to identify if fix for ticket 7028 is in trunk?

2009-05-18 Thread Alex Gaynor
On Mon, May 18, 2009 at 7:59 PM, Margie wrote: > > > > > It isn't in trunk, and you don't need to look at SVN to work that out. > > Ticket #7028 is still open. This means it hasn't been applied to > > trunk. When the code is applied to trunk, the ticket will be closed.

Re: how to identify if fix for ticket 7028 is in trunk?

2009-05-18 Thread Margie
> It isn't in trunk, and you don't need to look at SVN to work that out. > Ticket #7028 is still open. This means it hasn't been applied to > trunk. When the code is applied to trunk, the ticket will be closed. I see - so the 'Triage Stage' saying 'Ready for checkin' means that the attached

Re: how to identify if fix for ticket 7028 is in trunk?

2009-05-18 Thread Karen Tracey
On Mon, May 18, 2009 at 8:24 PM, Margie wrote: > > I am looking at ticket #7028 and trying to figure out if the > associated fix is in the trunk. No. Up at the very top of the page the ticket status is in parenthesis next to the number, and it is "New". New means

Re: how to identify if fix for ticket 7028 is in trunk?

2009-05-18 Thread Russell Keith-Magee
On Tue, May 19, 2009 at 8:24 AM, Margie wrote: > > I am looking at ticket #7028 and trying to figure out if the > associated fix is in the trunk.  It looks to me like the fix went into > the newforms-admin branch and when I look at my checked out trunk and > do: > > svn

Re: prepopulated fields in admin interface

2009-05-18 Thread Mohan Parthasarathy
On Mon, May 18, 2009 at 5:24 PM, Karen Tracey wrote: > On Mon, May 18, 2009 at 6:53 PM, Mohan Parthasarathy > wrote: > >> Hi, >> >> class CategoryAdmin(admin.ModelAdmin): >> prepopulated_fields = {'slug' : ('title', )} >> >> Why does the format

Re: prepopulated fields in admin interface

2009-05-18 Thread Karen Tracey
On Mon, May 18, 2009 at 6:53 PM, Mohan Parthasarathy wrote: > Hi, > > class CategoryAdmin(admin.ModelAdmin): > prepopulated_fields = {'slug' : ('title', )} > > Why does the format require a comma after "title'. It is still a valid > tuple without a comma, right ? No,

how to identify if fix for ticket 7028 is in trunk?

2009-05-18 Thread Margie
I am looking at ticket #7028 and trying to figure out if the associated fix is in the trunk. It looks to me like the fix went into the newforms-admin branch and when I look at my checked out trunk and do: svn log RelatedObjectLookups.js I see comments saying that the newforms-admin branch was

models unique_for_date

2009-05-18 Thread Mohan Parthasarathy
Hi, I can see that Models don't use the inner class to define the options, so I used class EntryAdmin(admin.ModelAdmin): prepopulated_fields = {'slug' : ('title',)} How do I use unique_for_date here ? Is there a place where all the options are listed for this new style interface ? I

User attribute access from within profile model

2009-05-18 Thread neri...@gmail.com
Hello, I have an Employee profile associated with Users who are staff, how do I return the associated user attributes from within the profile model i.e., 'full_name' from Users? Anytime I try to access the User attributes from within the profile class I get errors: Cannot resolve keyword

Re: List of available projects

2009-05-18 Thread Nick Lo
> Is there an official list of django projects - the code that can be > reused or to start with. I have done a few tutorials but don't want > to start writing everything from scratch. I googled and found a few. > But wondering whether there are anything within Django site iself ? Aside

Re: how to work with web service in django

2009-05-18 Thread Nick Lo
Hello, > I'm trying to make application in wich you will search some product > and for response my application will list you products from other > pages(for example amazon or some e-shop).. I want to do it with web > service and I have no idea where to start..does someone know how to >

Form Wizard and Saving to Database

2009-05-18 Thread geraldcor
Hello all, I am working on my second Django app and it involves a very long form. I successfully used modelForms in my last app to successfully save form data to a database. With this long form, I have split it up into smaller forms (forms.Form not ModelForms) and used the FormWizard to tie it

prepopulated fields in admin interface

2009-05-18 Thread Mohan Parthasarathy
Hi, class CategoryAdmin(admin.ModelAdmin): prepopulated_fields = {'slug' : ('title', )} Why does the format require a comma after "title'. It is still a valid tuple without a comma, right ? Without that, I keep getting errors. Sorry, If this was a dumb question. I am parallely doing

Re: user object in login.html

2009-05-18 Thread jon michaels
>From the documentation it seems that it is not only possible, but required too.. login_required() does the following: * If the user isn't logged in, redirect to settings.LOGIN_URL (/accounts/login/ by default), passing the current absolute URL in the query string as next or the value of

How to save the data from a form to my db.

2009-05-18 Thread jon michaels
Hi all, I have the a from with the following validated data posted to itself (copied from the POST section on the error page): cru'008' description u'asdfs' file u'suus' I am trying to save it to the database. The variable names are the same as the column names in the database. How can

user object in login.html

2009-05-18 Thread Rok
Hello. Is it possible to use user object in login.html when @login_required is used? I want to display login fields only when user is ianonymous. Thank you. Kind regards, Rok --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Including user's email in message body with a contact form

2009-05-18 Thread Catalyst
That did it! Thanks Alan. On May 18, 6:48 am, zayatzz wrote: > have you tried replacing > cd['message'], > with > cd['message']+cd['email'], > or > cd['message']+' your mail address is '+cd['email'], > > Alan. > > On May 18, 1:19 pm, Catalyst

Re: List of available projects

2009-05-18 Thread Masklinn
On 18 May 2009, at 20:20 , Mohan Parthasarathy wrote: > Hi, > > Is there an official list of django projects - the code that can be > reused > or to start with. I have done a few tutorials but don't want to start > writing everything from scratch. I googled and found a few. But > wondering >

Re: form won't post

2009-05-18 Thread Bobby Roberts
i figured out the issue... here's a tip to all those that are new to this wonderful platform if you set a field to required=True in your forms.py file but don't have it on your html form (if you hand build the forms like I do sometimes), django is designed to error gracefully and leave you

form won't post

2009-05-18 Thread Bobby Roberts
hi group. Please look at the code below. The form works fine if there is an error. However, if the form is ok, it's not processing the "form.is_valid" section of code. As programmed, the form should error out and say "spam" in an assertion but it doesn't get there. I can assert the form

ModelForm question

2009-05-18 Thread Rusty Greer
i have the following: a model: class MyClass(models.Model): otherClass = models.ForeignKey('otherClass') someData = models.CharField(max_length=20) class MyClassForm(forms.ModelForm): class Meta: model = MyClass fields = ('someData') When the user edits or adds a

Re: Dojo widgets inside Django

2009-05-18 Thread Alex Gaynor
On Mon, May 18, 2009 at 2:04 PM, Guri wrote: > > Hi, > Is there are way to use Dojo widgets inside Django forms.py? > > Any package, pointers or procedure will help. > > Thanks In Advance > ~Guri > > > http://code.google.com/p/dojango/ aims to do just that. Alex

Dojo widgets inside Django

2009-05-18 Thread Guri
Hi, Is there are way to use Dojo widgets inside Django forms.py? Any package, pointers or procedure will help. Thanks In Advance ~Guri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Implementing A/B Testing in Django

2009-05-18 Thread John Boxall
Using template_loader idea I've developed a little pluggable app for conducting basic A/B tests. You can grab it here: http://github.com/johnboxall/django-ab/tree/master John On May 16, 9:04 pm, John Boxall wrote: > I've got a new home page and I'd like to test it's

Re: List of available projects

2009-05-18 Thread Ariel Nunez
Check out Pinax [1] [1] http://pinaxproject.com On Mon, May 18, 2009 at 1:20 PM, Mohan Parthasarathy wrote: > Hi, > > Is there an official list of django projects - the code that can be reused > or to start with. I have done a few tutorials but don't want to start > writing

List of available projects

2009-05-18 Thread Mohan Parthasarathy
Hi, Is there an official list of django projects - the code that can be reused or to start with. I have done a few tutorials but don't want to start writing everything from scratch. I googled and found a few. But wondering whether there are anything within Django site iself ? thanks mohan

Re: Email form

2009-05-18 Thread Oli Warner
After a little hacking around, I ended up with this: (remember that the forms are inheriting this class, so the function has inherent access to fields - something I forgot): class EmailForm(forms.Form): def sendemail(self, fromAdd, toAdd, subject, keys=None, breaks=[], ignore=[]):

Re: MultiValueField with required=True problem

2009-05-18 Thread [CPR]-AL.exe
class CheckboxSelectWithTextInputWidget(forms.MultiWidget): def __init__(self,choices, attrs=None): widgets = ( forms.CheckboxSelectMultiple(choices = choices), forms.TextInput(), ) super(CheckboxSelectWithTextInputWidget,self).__init__

MultiValueField with required=True problem

2009-05-18 Thread [CPR]-AL.exe
Hello there. I've created a field+widget set that i use to render a number of checkboxes and a TextInput with comma-separated values. The problem is, when i set required = True, I get a ValidationError if only checkboxes are selected (but i don't get it if TextInput is filled) Here are the

Re: parsing data from fileupload

2009-05-18 Thread Chris Shenton
Oh, make sure your upload form specifies the 'enctype' attribute so it will actually send a file object, like: {% block content %} Upload a file... {{ form.as_p }} {% endblock %} --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: access to id of current user on admin

2009-05-18 Thread Martin Ostrovsky
Hi, You can define a custom save_models method in the ModelAdmin class you're associating with your Post class (i.e. in your admin.py file for the app in which Post resides). You can then access the user from the request (request.user). More info available at:

Re: parsing data from fileupload

2009-05-18 Thread Chris Shenton
On May 18, 2009, at 12:12 PM, Patrick wrote: > > Well, I guess what I'm confused about is adding data that doesn't come > directly from forms. > I ended up doing this and it seemed to work. > > for line in file: >b=Book() >b.title=line >b.save() Here is how I do it, Model, Form,

Re: Email form

2009-05-18 Thread Aneesh
I don't think there's a simple way to do this (someone correct me if I'm wrong!). The view that processes your form receives a POST (or GET) request containing only key-value pairs for the form fields. It doesn't get passed any other information about the form (incl labels). So, you'd have to

Re: parsing data from fileupload

2009-05-18 Thread Patrick
Well, I guess what I'm confused about is adding data that doesn't come directly from forms. I ended up doing this and it seemed to work. for line in file: b=Book() b.title=line b.save() Thanks On May 17, 3:41 pm, Alex Gaynor wrote: > On Sun, May 17, 2009 at

Re: how to work with web service in django

2009-05-18 Thread Michael
On Mon, May 18, 2009 at 10:55 AM, LiLi wrote: > hey satchmo is really great solution..thank you for that.. but I don't have > to do e-shop.. only page that will list information of some product from > other page.. In fact that is only parsing but I don't know how to do it..

Re: Theory - where & how to handle common functions & views

2009-05-18 Thread TiNo
On Mon, May 18, 2009 at 4:06 PM, zayatzz wrote: > > > Where is not such a big deal. You could write a function in view that you > > reuse multiple times (maybe start its name with an _ to show that it is > not > > a public function cq just a helper function), or you

Email form

2009-05-18 Thread Oli Warner
I've made a couple of forms that are basically supposed to dump their content into an email and send that on. My forms both inherit this class: class EmailForm(forms.Form): def sendemail(self, fromAdd, toAdd, subject, keys=None): body = '' if not keys: keys =

Re: how to work with web service in django

2009-05-18 Thread LiLi
hey satchmo is really great solution..thank you for that.. but I don't have to do e-shop.. only page that will list information of some product from other page.. In fact that is only parsing but I don't know how to do it.. do you think that I have to use satchmo anyway? I'm looking for

Re: Implementing A/B Testing in Django

2009-05-18 Thread John Boxall
Thanks Tino, I am aware of GWO - just thought it would be a cool project to try! It looks like the local threads / request object available in the template loader trick is going to work - just gotta clear up some possible caching issues then it'll be ready for release. Cheers, John On May

Re: Passing a dynamic ChoiceField response to a ForeignKey instance

2009-05-18 Thread Simon Greenwood
On May 18, 12:02 pm, Simon Greenwood wrote: > On May 15, 5:58 pm, simong wrote: > > > > > There's probably a very simple answer to this but I can't see it at > > the moment: > > > This model: > > > class Product(models.Model): > >         user =

Re: Theory - where & how to handle common functions & views

2009-05-18 Thread zayatzz
> Where is not such a big deal. You could write a function in view that you > reuse multiple times (maybe start its name with an _ to show that it is not > a public function cq just a helper function), or you could put it into a > util.py file and import it in your views.py > > How totally

Import Error: couldn't locate module Http.Isapi

2009-05-18 Thread BuckRogers
Hi, I am using IIS6/Python2.5/mssql 2000 on windows server 2003 I followed the instructions available here: http://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer PyISAPIe doesn't seem to work, I am getting Import Error: couldn't locate module Http.Isapi Any idea? Cheers

Re: Theory - where & how to handle common functions & views

2009-05-18 Thread TiNo
On Sat, May 16, 2009 at 10:59 AM, zayatzz wrote: > > Hello > > I have several views that pass same info into templates. If i want to > change information that gets passed into template then i have to > change several views to get system up to date and this is not good.

Re: Including user's email in message body with a contact form

2009-05-18 Thread zayatzz
have you tried replacing cd['message'], with cd['message']+cd['email'], or cd['message']+' your mail address is '+cd['email'], Alan. On May 18, 1:19 pm, Catalyst wrote: >  I followed the instructions here to build a contact >

Re: Django superusers

2009-05-18 Thread Mike Driscoll
Don, On May 15, 11:08 am, donarb wrote: > On May 15, 7:31 am, Mike Driscoll wrote: > > > The book does not mention anything about the autodiscover() call, > > although it seems to have done everything else right. Once I added > > that, the admin pages

Making inline form completion 'required'

2009-05-18 Thread Alfonso
Hi, I want to make the completion of an inline form called 'orders' required within the parent 'Invoices' admin change form. To stop users generating invoices with no orders attached to them. Is there an easy way to implement that? Thanks --~--~-~--~~~---~--~~

Re: Theory - where & how to handle common functions & views

2009-05-18 Thread zayatzz
Since i did not get answer ill explain my problem bit more. in first case (views). my current views work like that: They take request data, read session info and generate content related to that. I understand, that i could write function that takes request as argument. But since it has to

Re: How do I migrate

2009-05-18 Thread Kenneth Gonsalves
On Monday 18 May 2009 15:54:13 madhan...@gmail.com wrote: > 1. Do we need to install and configure Django form scratch inorder to > make the system workable? yes. > 2. Is it not possible to make it work just by move the files and DB. no check the django documentation for details. Oh, and, if

How do I migrate

2009-05-18 Thread madhan...@gmail.com
Hi all, I am stuck up with something. One of our clients has a system developed using Django framework. We need to migrate the system to our servers. We basically develop PHP sites, python and Django is kinda new to us. How do I setup the system in our servers. The server people has configured us

Re: Oracle connection "cx_Oracle.DatabaseError: ORA-00911: invalid character"

2009-05-18 Thread Doug
Thanks for your response Karen. And I am so new into Django that there is no real harm is re-installing v1, and trying again. However, I believe that I am experiencing the problem with V1. I'll let you know what I find. Doug On May 17, 4:58 pm, Karen Tracey wrote: > On

Re: Passing a dynamic ChoiceField response to a ForeignKey instance

2009-05-18 Thread Simon Greenwood
On May 15, 5:58 pm, simong wrote: > There's probably a very simple answer to this but I can't see it at > the moment: > > This model: > > class Product(models.Model): >         user = models.ForeignKey(User, related_name="product_list", > editable=False) >        

access to id of current user on admin

2009-05-18 Thread Alfredo Alessandrini
Hi, I'm write a model for a post. Can I access to id of current user on admin site? I'm trying with: author = models.ForeignKey(User, default=User.id, blank=True, null=True) But don' work... Thanks, Alfredo -- from django.db import models from

Re: subscription based web app - want to develop - bounty

2009-05-18 Thread Dougal Matthews
This hasn't been updated since August 2007, so there is pretty much no chance it will work with 1.0 or 1.1 out of the box. However, you might find its a good base to work from; http://code.google.com/p/django-accounts/ The feature list claims; 1. subdomain-based accounts ie:

Re: login decorator losing POST data

2009-05-18 Thread Tim Chase
Tom Evans wrote: > On Fri, 2009-05-15 at 16:10 -0500, Tim Chase wrote: >> James Bennett wrote: >>> On Fri, May 15, 2009 at 1:55 PM, Tim Chase >>> wrote: One more option that occurs to me is that you can stash all of the POSTed variables into a

Including user's email in message body with a contact form

2009-05-18 Thread Catalyst
I followed the instructions here to build a contact form: http://www.djangobook.com/en/2.0/chapter07/ This works great, except I want to add the user's email address into the message body of the email that's sent through. In other words... To: [Site Owner's Email] From: [User's Email]

Django developer salary rate in USA

2009-05-18 Thread Joshua Partogi
Hi everyone, I'm looking for opportunity for a django career in USA (Note: I've never been to US in my entire life). Now can anyone give me a ballpark figure of the salary rate as a django developer in the US? I've tried looking in djangogigs.com but can not find an estimate of salary rate in the

RequiredIfOtherFieldEquals error

2009-05-18 Thread Christian Martín Reinhold
Hello I am kind of new with django and I am trying to adapt a piece of code to the 1.0 version. datetime = models.DateTimeField(blank=True, null=True, validator_list=[RequiredIfOtherFieldEquals('status', '2',("A datetime " "must be specified if status is

Re: LANGUAGE_CODE

2009-05-18 Thread Kai Kuehne
Hi, 2009/5/18 sammysun : > On May 18, 6:07 am, Kai Kuehne wrote: >> Why do you expect an english term when you said django >> you want chinese text? > {{ d|date:"F Y" }},there d is > a DateTimeField. I want to get the url like "/blog/may/", not "/blog/五 >

Re: Ordering a query by comments connected to model

2009-05-18 Thread Martin Lundberg
Thanks Andy for the help and Alex for clarifying. I'll do as Andy said and denormalize the data and add a comments counter field to the entry model. (Deconfuse: I changed my display name from Marlun to my whole name after creating this thread.) -Martin On May 16, 3:58 pm, Alex Gaynor

Re: LANGUAGE_CODE

2009-05-18 Thread sammysun
On May 18, 6:07 am, Kai Kuehne wrote: > Hi, > > 2009/5/17 sammysun : > > > > > Hi: > >When I set LANGUAGE_CODE = 'zh-cn' in the sitting file. I want to > > get a 3 letters of month useing filter "date" in the template, e.g. > > Useing {{

Re: how to use filter

2009-05-18 Thread Aaron Maxwell
On Sunday 17 May 2009 11:00:15 pm laspal wrote: > list = Status.objects.filter(someid = 20, value < val2, value > val1) try this: list = Status.objects.filter(someid=20, value__lt=val2).filter(value__gt=val1) -- Aaron Maxwell http://redsymbol.net/

how to use filter

2009-05-18 Thread laspal
Hi, class Status(models.Model): someid = models.IntegerField() value = models.IntegerField() status_msg = models.CharField(max_length = 2000) so my database look like: 20 1234567890 'some mdg' 20 4597434534 'some msg2' 20 345394593'sdfgsdf' 10 450348534