Re: DjangoCon US 2011

2011-03-31 Thread Shawn Milochik
The event will definitely take place in Portland, Oregon in September.

On Apr 1, 2011 12:15 AM, "Vinicius Mendes"  wrote:
>
> I work for a company that assist employees to go to events to learn about
technologies they use. They always plan wich events their employees will
attend in the begining of the year. I am trying to go to DjangoCon US with
their help so I need to know if the event will take place or not.
>
> Atenciosamente,
> Vinicius Mendes
> Engenheiro de Computação
> Globo.com
>
>
>
> On Thu, Mar 31, 2011 at 8:49 PM, Steve Holden  wrote:
>>
>> I have already started nagging people about this. It's only just over
five months to go, and it's definitely time the CfP went out. Expect to see
movement in the next two weeks.
>>
>> Regards
>> Steve
>>
>> On Mar 31, 2011 6:19 PM, "Shawn Milochik"  wrote:
>> > It's a bit early, in the year, but I'd expect something in the next
>> > couple of months here:
>> >
>> > http://djangocon.us/
>> >
>> > Since it's not till September there's still plenty of time.
>> >
>> > That said, if @holdenweb is reading this -- any updates? ^_^
>> >
>> > Shawn
>> >
>> > --
>> > You received this message because you are subscribed to the Google
Groups "Django users" group.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
"Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DjangoCon US 2011

2011-03-31 Thread Vinicius Mendes
I work for a company that assist employees to go to events to learn about
technologies they use. They always plan wich events their employees will
attend in the begining of the year. I am trying to go to DjangoCon US with
their help so I need to know if the event will take place or not.

Atenciosamente,
Vinicius Mendes
Engenheiro de Computação
Globo.com



On Thu, Mar 31, 2011 at 8:49 PM, Steve Holden  wrote:

> I have already started nagging people about this. It's only just over five
> months to go, and it's definitely time the CfP went out. Expect to see
> movement in the next two weeks.
>
> Regards
> Steve
> On Mar 31, 2011 6:19 PM, "Shawn Milochik"  wrote:
> > It's a bit early, in the year, but I'd expect something in the next
> > couple of months here:
> >
> > http://djangocon.us/
> >
> > Since it's not till September there's still plenty of time.
> >
> > That said, if @holdenweb is reading this -- any updates? ^_^
> >
> > Shawn
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Serve a tracking pixel via Django

2011-03-31 Thread Javier Guerra Giraldez
On Thu, Mar 31, 2011 at 7:18 PM, Russell Keith-Magee
 wrote:
> Sure. Write a view that returns the content. It's 3 lines of code (a
> couple more if you count imports and whitespace). Added bonus -- it's
> actually more efficient than serve(), because it doesn't impose a disk
> access overhead every time it gets called.

even better, use nginx empty_gif and get the tracking data from the logs.


-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Strange admin changelist bug with list_editable and FK to User in 1.2.3

2011-03-31 Thread Nan

Ah, that does look like it could be the same thing.  Thank you!  The
ticket suggests it was backported, so I'll try upgrading to 1.2.5.

On Mar 31, 7:41 pm, Karen Tracey  wrote:
> On Thu, Mar 31, 2011 at 3:35 PM, Nan  wrote:
> > Any idea what might be going on?  I'm using 1.2.3 at the moment, and
> > the client doesn't want to authorize the work to upgrade to 1.3 just
> > yet, so I can't determine whether it's version-specific.
>
> Sounds rather like:
>
> http://code.djangoproject.com/ticket/12475
>
> which is fixed in 1.3.
>
> Karen
> --http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to check the text field values are in my database or not ?

2011-03-31 Thread Nge Nge
Hi All!

How can I check the text field value in my database ?
For example, I type user name and password from text box on my web
page. Then I want to check these values are in my database or not.
How should I do? I am using postgresql database.


Thanks
Nge Nge

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: WxPython and django

2011-03-31 Thread Mike Ramirez
On Thursday, March 31, 2011 06:34:42 pm Aref Nammari wrote:
> Hi Calvin,  I think that there is some misunderstanding about what my
> question was about. Let me try to clarify. Wxpython is a module which is
> run just like any other python module. It is great for rendering forms,
> widgets, frames etc...and it has within it an html module. You can embed
> wxpython within html code.
> Since wxpython is a python module and if you can run python code in django
> apps then you should be able to run wxpython code provided the right
> modules are imported--just like any other python module. What I was
> thinking of doing is either embed some wxpython code within html to render
> the different pages of the django app or call wxpython functions from the
> html template. All the code resides on the server of course. The user
> interacts with the app through the web page. So the forms would be
> rendered by wxpython instead of html. I don't know if this is clearer or
> if what I am thinking of is feasible at all.
> 


It's not feasable at all. Thing is, wxPython is a python bindings to 
wxwidgets, which is a c++ gui framework.  The browser will not know how to 
handle them, this is on purpose.  The browser itself does all the actual 
rendering of widgets from within its html engine, the browser should not know 
about wxwidgets, even if it itself is written in wx, this way.

Don't let how the code is written fool you. wxpython is not going to work the 
way you think it is.  Browsers for security reasons do not execute random code 
and you can not send the widgets over the network that way, You'll need to 
rewrite the gui code. 
 

Mike

-- 
* LG loves czech girls.
 LG: do they have additional interesting "features" other girls don't 
have? ;)
-- #Debian

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Need help: request.POST.copy() ?

2011-03-31 Thread hank23
Thanks. I will recheck my code and see if I can fix it. If I'm not
successful in fixing it, I'll be back on tomorrow asking some more
questions. Thanks again for the help and suggestions.

On Mar 31, 9:12 pm, Sam Walters  wrote:
> Yes, Id really need to see some code to work it out.
>
> A bit hard to work out wether you're returning the request.POST.copy()
> and wether this is instantiated in a new form instance and returned.
> Eg: if form validation fails.
> Or wether you are  having trouble redisplaying the original
> request.POST data in a new form or one thats failed evaluation?
>
> Once again would need to see the some code.
>
> >> I actually call sub views from the main view which processes this
> >> screen, display the data as shown above as well as capture the changes
> >> to the request.POST dictionary like this:
>
> >> title = request.POST['title']
>
> Hmm, dont forget:http://en.wikipedia.org/wiki/Pass_by_reference
>
> Here is some of my basic code... eg: adding a new param 'IP address'
> to request.POST form data for evaluation. This might help.
>
> def contact(request):
>     from hvv.contact.forms import ContactEmailForm
>     #form validation: Note: ip address is not form data, is validated
> as form and added to formdata by 'getIpAddr()'
>     if request.is_ajax() and request.POST:
>         #Note: copy() makes QueryDict Mutable
>         data = QueryDict(request.POST['form']).copy()
>         data.update({'ipaddress': getIpAddr(request) })
>         form = ContactEmailForm(data)
>         if form.is_valid():
>             n_email = form.cleaned_data['email']
>             n_subject = form.cleaned_data['subject']
>             n_message = form.cleaned_data['message']
>             n_ipaddr = form.cleaned_data['ipaddress']
>
>             saveInDb(n_email, n_subject, n_message, n_ipaddr)
>             sendEmail(n_email, n_subject, n_message, n_ipaddr)
>
>             return render_to_response('contact.html', {
> 'form':ContactEmailForm(), 'message':'Thankyou. Your message was
> sent!.' }, context_instance=RequestContext(request))
>         else:
>             return render_to_response('contact.html', { 'form':form },
> context_instance=RequestContext(request))
>     form = ContactEmailForm()
>     return render_to_response('contact.html', { 'form':form },
> context_instance=RequestContext(request))
>
> cheers
>
> sam_w
>
>
>
> On Fri, Apr 1, 2011 at 12:30 PM, hank23  wrote:
> > Sorry the last example I gave maybe wrong. I think I'm actually
> > getting the data back out using the cleaned_data. I'm trying to do
> > this from memory, since this is a work problem and I've been
> > struggling with it since the middle of this afternoon and it's been
> > very frustrating.
>
> > On Mar 31, 8:24 pm, hank23  wrote:
> >> Currently I have logic in place that makes a copy of request.POST so
> >> it can put data from a record using a key, gotten from the previous
> >> bunch of POSTed data, on the screen for display purposes. This all
> >> works fine. But when I go in and alter some of the data being
> >> displayed then the next time I submit the form the data that I just
> >> entered is not displaying in the request.POST dictionary when I look
> >> at it. So what am I apparently not doing right to cause the data to be
> >> lost? I display the data to the screen after making a copy of
> >> request.POST (request.POST.copy()) like this:
>
> >> request.POST['title'] = record.title
>
> >> I actually call sub views from the main view which processes this
> >> screen, display the data as shown above as well as capture the changes
> >> to the request.POST dictionary like this:
>
> >> title = request.POST['title']
>
> >> After trying to capture the data this way then I try to write it to
> >> the database, but nothing new is being saved, so that's why I'm
> >> wondering why no new data  is being saved.
>
> >> On Mar 31, 8:07 pm, Sam Walters  wrote:
>
> >> > Hi hank23
> >> > request.POST would be immutable.
>
> >> > "QueryDict instances are immutable, unless you create a copy() of
> >> > them. That means you can't change attributes of request.POST and
> >> > request.GET directly."
>
> >> >http://docs.djangoproject.com/en/dev/ref/request-response/
>
> >> > So I'm
>
> >> > > wondering if there is something else going on or if this problem is
> >> > > some kind of side effect of using request.POST.copy()?
>
> >> > I dont know what you mean by side-effect.
>
> >> > I copy/instantiate querydicts all the time never had any problems.
> >> > Dont forget if you can use python to clone objects :)
>
> >> > cheers
>
> >> > sam_W
>
> >> > On Fri, Apr 1, 2011 at 11:48 AM, hank23  wrote:
> >> > > I need to know when I can or should use request.POST.copy() when
> >> > > processing screens, as opposed to when not to use it. I've used it
> >> > > some, on one screen in particular, which seems to work fine for
> >> > > 

best way to define a many-to-one relationship using FreeRadius' existing DB schema

2011-03-31 Thread yolabingo
Thanks in advance for any insight or suggestions.

I have a simple web interface for a freeradius mysql database.  It
uses the Django admin interface exclusively, and makes it simple to
manage Radius usernames, passwords, preferences etc, which we use for
authentication on WiFi hotspots.

My question - how can I best use "models.ForeignKey" to associate
freeradius accounting data with the "WifiUser" I am using to manage
radius usernames/passwords/etc?

Here's a portion of the WifiUser model:

class WifiUser(models.Model):
username =  models.CharField( max_length=64,
unique=True )
password =  models.CharField( max_length=64 )
# Radius attributes -see http://coova.org/CoovaChilli/Proxy#toc6
session_timeout = models.CharField( max_length=64, blank=True,
default='21600' )
# These point to entries in freeradius db tables
   radius_password = models.OneToOneField(RadiusPassword,
editable=False)
   radius_session_timeout = models.OneToOneField(RadiusSessionTimeout,
editable=False)

I then use Signals to update the appropriate freeradius db tables as
necessary (e.g., WifiUser.password is changed, the new value is also
stored in WifiUser.radius_password.value) - it works great, thank you
Django.

What I would like to do is have access to a WifiUser's radius
accounting data via the Django Admin interface.
This table looks like:

CREATE TABLE `radacct` (
`radacctid` bigint NOT NULL PRIMARY KEY,
`username` varchar(192) NOT NULL,
 bunch of cool radius info logged per session
 --snip--
So the radacct.username ==  WifiUser.username - but that is all I've
got to associate these two tables.

Can I set up some customized version of this Many-to-One relationship
-
class RadiusAccounting(models.Model):
wifiuser = models.ForeignKey('WifiUser')

in which I specify that "RadiusAccounting.username ==
WifiUser.username" instead of
"RadiusAccounting.wifiuser_id == WifiUser.id:  -- thus reaping the
benefits of a normal ForeignKey relationship?

Regards,
Todd

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Need help: request.POST.copy() ?

2011-03-31 Thread Sam Walters
Yes, Id really need to see some code to work it out.

A bit hard to work out wether you're returning the request.POST.copy()
and wether this is instantiated in a new form instance and returned.
Eg: if form validation fails.
Or wether you are  having trouble redisplaying the original
request.POST data in a new form or one thats failed evaluation?

Once again would need to see the some code.

>> I actually call sub views from the main view which processes this
>> screen, display the data as shown above as well as capture the changes
>> to the request.POST dictionary like this:
>>
>> title = request.POST['title']

Hmm, dont forget:
http://en.wikipedia.org/wiki/Pass_by_reference

Here is some of my basic code... eg: adding a new param 'IP address'
to request.POST form data for evaluation. This might help.

def contact(request):
from hvv.contact.forms import ContactEmailForm
#form validation: Note: ip address is not form data, is validated
as form and added to formdata by 'getIpAddr()'
if request.is_ajax() and request.POST:
#Note: copy() makes QueryDict Mutable
data = QueryDict(request.POST['form']).copy()
data.update({'ipaddress': getIpAddr(request) })
form = ContactEmailForm(data)
if form.is_valid():
n_email = form.cleaned_data['email']
n_subject = form.cleaned_data['subject']
n_message = form.cleaned_data['message']
n_ipaddr = form.cleaned_data['ipaddress']

saveInDb(n_email, n_subject, n_message, n_ipaddr)
sendEmail(n_email, n_subject, n_message, n_ipaddr)

return render_to_response('contact.html', {
'form':ContactEmailForm(), 'message':'Thankyou. Your message was
sent!.' }, context_instance=RequestContext(request))
else:
return render_to_response('contact.html', { 'form':form },
context_instance=RequestContext(request))
form = ContactEmailForm()
return render_to_response('contact.html', { 'form':form },
context_instance=RequestContext(request))

cheers

sam_w




On Fri, Apr 1, 2011 at 12:30 PM, hank23  wrote:
> Sorry the last example I gave maybe wrong. I think I'm actually
> getting the data back out using the cleaned_data. I'm trying to do
> this from memory, since this is a work problem and I've been
> struggling with it since the middle of this afternoon and it's been
> very frustrating.
>
>
>
> On Mar 31, 8:24 pm, hank23  wrote:
>> Currently I have logic in place that makes a copy of request.POST so
>> it can put data from a record using a key, gotten from the previous
>> bunch of POSTed data, on the screen for display purposes. This all
>> works fine. But when I go in and alter some of the data being
>> displayed then the next time I submit the form the data that I just
>> entered is not displaying in the request.POST dictionary when I look
>> at it. So what am I apparently not doing right to cause the data to be
>> lost? I display the data to the screen after making a copy of
>> request.POST (request.POST.copy()) like this:
>>
>> request.POST['title'] = record.title
>>
>> I actually call sub views from the main view which processes this
>> screen, display the data as shown above as well as capture the changes
>> to the request.POST dictionary like this:
>>
>> title = request.POST['title']
>>
>> After trying to capture the data this way then I try to write it to
>> the database, but nothing new is being saved, so that's why I'm
>> wondering why no new data  is being saved.
>>
>> On Mar 31, 8:07 pm, Sam Walters  wrote:
>>
>>
>>
>> > Hi hank23
>> > request.POST would be immutable.
>>
>> > "QueryDict instances are immutable, unless you create a copy() of
>> > them. That means you can't change attributes of request.POST and
>> > request.GET directly."
>>
>> >http://docs.djangoproject.com/en/dev/ref/request-response/
>>
>> > So I'm
>>
>> > > wondering if there is something else going on or if this problem is
>> > > some kind of side effect of using request.POST.copy()?
>>
>> > I dont know what you mean by side-effect.
>>
>> > I copy/instantiate querydicts all the time never had any problems.
>> > Dont forget if you can use python to clone objects :)
>>
>> > cheers
>>
>> > sam_W
>>
>> > On Fri, Apr 1, 2011 at 11:48 AM, hank23  wrote:
>> > > I need to know when I can or should use request.POST.copy() when
>> > > processing screens, as opposed to when not to use it. I've used it
>> > > some, on one screen in particular, which seems to work fine for
>> > > displaying the data that I want to display, when I put the data on the
>> > > screen programatically from within a view. However when I try to alter
>> > > the data manually by keying it in from my keyboard, or selecting an
>> > > option from a dropdown, nothing seems to show up changed the next time
>> > > that submit the form to the view and look at the data posted. So I'm
>> > > wondering if there is 

Re: WxPython and django

2011-03-31 Thread Aref Nammari
Hi Calvin,  I think that there is some misunderstanding about what my
question was about. Let me try to clarify. Wxpython is a module which is run
just like any other python module. It is great for rendering forms, widgets,
frames etc...and it has within it an html module. You can embed wxpython
within html code.
Since wxpython is a python module and if you can run python code in django
apps then you should be able to run wxpython code provided the right modules
are imported--just like any other python module. What I was thinking of
doing is either embed some wxpython code within html to render the different
pages of the django app or call wxpython functions from the html template.
All the code resides on the server of course. The user interacts with the
app through the web page. So the forms would be rendered by wxpython instead
of html. I don't know if this is clearer or if what I am thinking of is
feasible at all.

On Thu, Mar 31, 2011 at 6:33 PM, Calvin Spealman wrote:

> Then on what machine would the wx version run on? The user's machine
> or the server? If on the user's machine, how does it talk to the
> database? If on the server, how does the user interact with it?
>
> On Thu, Mar 31, 2011 at 9:04 AM, Aref Nammari 
> wrote:
> > Calvin,
> >
> > The database as well as the django app sits on a server
> > (internal--this is not meant for public access by the general public).
> > To access the app users would have to login to the server through http
> > and run the app from there.
> >
> > On 3/31/11, Calvin Spealman  wrote:
> >> Aref,
> >>
> >> The question I would have is where your database sits. Is it supposed
> >> to sit on a central server? In a website, your database only needs to
> >> be accessed by machine rendering the pages. If you want the same
> >> database talking to desktop applications, you need to let those apps
> >> talk to the database or run the database on individual users'
> >> machines. This is the part that concerns me, especially giving those
> >> users access to a central DB.
> >>
> >> On Thu, Mar 31, 2011 at 7:05 AM, Aref Nammari 
> wrote:
> >>> Thanks for the reply Calvin. I realize what django is about and what it
> is
> >>> meant for and I do understand what WxPython is capable of. I still
> think
> >>> that this does not prevent using wxpython as a frontend for django
> >>> app--instead of (or in conjunction with) HTML to render the page Iam
> >>> thinking that I should be able to use wxpython--pass the data to
> wxpython
> >>> module to display and take data from a form rendered with wxpython and
> >>> send
> >>> to django. This must doable I think.
> >>>
> >>> On Wed, Mar 30, 2011 at 8:24 PM, Calvin Spealman  >
> >>> wrote:
> 
>  They are completely unrelated. WX is a library for working with
>  desktop-based UI toolkits, and Django is a framework for producing and
>  delivering HTML/CSS/JS web content to a browser.
> 
>  On Wed, Mar 30, 2011 at 10:03 PM, Aref  wrote:
>  > Hello,
>  >
>  > I have created a small app with wxpython to manage and query
> databases
>  > and now I am learning django and was wondering if it is possible to
>  > incorporate some of the wxpython code in django. What I am trying to
>  > do is to create the same app as the one in wxpython but make it web-
>  > based rather than desktop. I know the django admin does that but I
>  > wanted to learn how to create web based apps and thought that would
> be
>  > a good exercise. Thanks for any pointers or ideas.
>  >
>  > --
>  > You received this message because you are subscribed to the Google
>  > Groups "Django users" group.
>  > To post to this group, send email to django-users@googlegroups.com.
>  > To unsubscribe from this group, send email to
>  > django-users+unsubscr...@googlegroups.com.
>  > For more options, visit this group at
>  > http://groups.google.com/group/django-users?hl=en.
>  >
>  >
> 
> 
> 
>  --
>  Read my blog! I depend on your acceptance of my opinion! I am
>  interesting!
>  http://techblog.ironfroggy.com/
>  Follow me if you're into that sort of thing:
>  http://www.twitter.com/ironfroggy
> >>>
> >>>
> >>
> >>
> >>
> >> --
> >> Read my blog! I depend on your acceptance of my opinion! I am
> interesting!
> >> http://techblog.ironfroggy.com/
> >> Follow me if you're into that sort of thing:
> >> http://www.twitter.com/ironfroggy
> >>
> >
>
>
>
> --
> Read my blog! I depend on your acceptance of my opinion! I am interesting!
> http://techblog.ironfroggy.com/
> Follow me if you're into that sort of thing:
> http://www.twitter.com/ironfroggy
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to 

Re: Need help: request.POST.copy() ?

2011-03-31 Thread hank23
Sorry the last example I gave maybe wrong. I think I'm actually
getting the data back out using the cleaned_data. I'm trying to do
this from memory, since this is a work problem and I've been
struggling with it since the middle of this afternoon and it's been
very frustrating.



On Mar 31, 8:24 pm, hank23  wrote:
> Currently I have logic in place that makes a copy of request.POST so
> it can put data from a record using a key, gotten from the previous
> bunch of POSTed data, on the screen for display purposes. This all
> works fine. But when I go in and alter some of the data being
> displayed then the next time I submit the form the data that I just
> entered is not displaying in the request.POST dictionary when I look
> at it. So what am I apparently not doing right to cause the data to be
> lost? I display the data to the screen after making a copy of
> request.POST (request.POST.copy()) like this:
>
> request.POST['title'] = record.title
>
> I actually call sub views from the main view which processes this
> screen, display the data as shown above as well as capture the changes
> to the request.POST dictionary like this:
>
> title = request.POST['title']
>
> After trying to capture the data this way then I try to write it to
> the database, but nothing new is being saved, so that's why I'm
> wondering why no new data  is being saved.
>
> On Mar 31, 8:07 pm, Sam Walters  wrote:
>
>
>
> > Hi hank23
> > request.POST would be immutable.
>
> > "QueryDict instances are immutable, unless you create a copy() of
> > them. That means you can't change attributes of request.POST and
> > request.GET directly."
>
> >http://docs.djangoproject.com/en/dev/ref/request-response/
>
> > So I'm
>
> > > wondering if there is something else going on or if this problem is
> > > some kind of side effect of using request.POST.copy()?
>
> > I dont know what you mean by side-effect.
>
> > I copy/instantiate querydicts all the time never had any problems.
> > Dont forget if you can use python to clone objects :)
>
> > cheers
>
> > sam_W
>
> > On Fri, Apr 1, 2011 at 11:48 AM, hank23  wrote:
> > > I need to know when I can or should use request.POST.copy() when
> > > processing screens, as opposed to when not to use it. I've used it
> > > some, on one screen in particular, which seems to work fine for
> > > displaying the data that I want to display, when I put the data on the
> > > screen programatically from within a view. However when I try to alter
> > > the data manually by keying it in from my keyboard, or selecting an
> > > option from a dropdown, nothing seems to show up changed the next time
> > > that submit the form to the view and look at the data posted. So I'm
> > > wondering if there is something else going on or if this problem is
> > > some kind of side effect of using request.POST.copy()?
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Django users" group.
> > > To post to this group, send email to django-users@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > django-users+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/django-users?hl=en.-Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Need help: request.POST.copy() ?

2011-03-31 Thread hank23
Currently I have logic in place that makes a copy of request.POST so
it can put data from a record using a key, gotten from the previous
bunch of POSTed data, on the screen for display purposes. This all
works fine. But when I go in and alter some of the data being
displayed then the next time I submit the form the data that I just
entered is not displaying in the request.POST dictionary when I look
at it. So what am I apparently not doing right to cause the data to be
lost? I display the data to the screen after making a copy of
request.POST (request.POST.copy()) like this:

request.POST['title'] = record.title

I actually call sub views from the main view which processes this
screen, display the data as shown above as well as capture the changes
to the request.POST dictionary like this:

title = request.POST['title']

After trying to capture the data this way then I try to write it to
the database, but nothing new is being saved, so that's why I'm
wondering why no new data  is being saved.

On Mar 31, 8:07 pm, Sam Walters  wrote:
> Hi hank23
> request.POST would be immutable.
>
> "QueryDict instances are immutable, unless you create a copy() of
> them. That means you can't change attributes of request.POST and
> request.GET directly."
>
> http://docs.djangoproject.com/en/dev/ref/request-response/
>
> So I'm
>
> > wondering if there is something else going on or if this problem is
> > some kind of side effect of using request.POST.copy()?
>
> I dont know what you mean by side-effect.
>
> I copy/instantiate querydicts all the time never had any problems.
> Dont forget if you can use python to clone objects :)
>
> cheers
>
> sam_W
>
>
>
> On Fri, Apr 1, 2011 at 11:48 AM, hank23  wrote:
> > I need to know when I can or should use request.POST.copy() when
> > processing screens, as opposed to when not to use it. I've used it
> > some, on one screen in particular, which seems to work fine for
> > displaying the data that I want to display, when I put the data on the
> > screen programatically from within a view. However when I try to alter
> > the data manually by keying it in from my keyboard, or selecting an
> > option from a dropdown, nothing seems to show up changed the next time
> > that submit the form to the view and look at the data posted. So I'm
> > wondering if there is something else going on or if this problem is
> > some kind of side effect of using request.POST.copy()?
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Need help: request.POST.copy() ?

2011-03-31 Thread Sam Walters
Hi hank23
request.POST would be immutable.

"QueryDict instances are immutable, unless you create a copy() of
them. That means you can't change attributes of request.POST and
request.GET directly."

http://docs.djangoproject.com/en/dev/ref/request-response/


So I'm
> wondering if there is something else going on or if this problem is
> some kind of side effect of using request.POST.copy()?

I dont know what you mean by side-effect.

I copy/instantiate querydicts all the time never had any problems.
Dont forget if you can use python to clone objects :)

cheers

sam_W


On Fri, Apr 1, 2011 at 11:48 AM, hank23  wrote:
> I need to know when I can or should use request.POST.copy() when
> processing screens, as opposed to when not to use it. I've used it
> some, on one screen in particular, which seems to work fine for
> displaying the data that I want to display, when I put the data on the
> screen programatically from within a view. However when I try to alter
> the data manually by keying it in from my keyboard, or selecting an
> option from a dropdown, nothing seems to show up changed the next time
> that submit the form to the view and look at the data posted. So I'm
> wondering if there is something else going on or if this problem is
> some kind of side effect of using request.POST.copy()?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Need help: request.POST.copy() ?

2011-03-31 Thread hank23
I need to know when I can or should use request.POST.copy() when
processing screens, as opposed to when not to use it. I've used it
some, on one screen in particular, which seems to work fine for
displaying the data that I want to display, when I put the data on the
screen programatically from within a view. However when I try to alter
the data manually by keying it in from my keyboard, or selecting an
option from a dropdown, nothing seems to show up changed the next time
that submit the form to the view and look at the data posted. So I'm
wondering if there is something else going on or if this problem is
some kind of side effect of using request.POST.copy()?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: WxPython and django

2011-03-31 Thread Calvin Spealman
Then on what machine would the wx version run on? The user's machine
or the server? If on the user's machine, how does it talk to the
database? If on the server, how does the user interact with it?

On Thu, Mar 31, 2011 at 9:04 AM, Aref Nammari  wrote:
> Calvin,
>
> The database as well as the django app sits on a server
> (internal--this is not meant for public access by the general public).
> To access the app users would have to login to the server through http
> and run the app from there.
>
> On 3/31/11, Calvin Spealman  wrote:
>> Aref,
>>
>> The question I would have is where your database sits. Is it supposed
>> to sit on a central server? In a website, your database only needs to
>> be accessed by machine rendering the pages. If you want the same
>> database talking to desktop applications, you need to let those apps
>> talk to the database or run the database on individual users'
>> machines. This is the part that concerns me, especially giving those
>> users access to a central DB.
>>
>> On Thu, Mar 31, 2011 at 7:05 AM, Aref Nammari  wrote:
>>> Thanks for the reply Calvin. I realize what django is about and what it is
>>> meant for and I do understand what WxPython is capable of. I still think
>>> that this does not prevent using wxpython as a frontend for django
>>> app--instead of (or in conjunction with) HTML to render the page Iam
>>> thinking that I should be able to use wxpython--pass the data to wxpython
>>> module to display and take data from a form rendered with wxpython and
>>> send
>>> to django. This must doable I think.
>>>
>>> On Wed, Mar 30, 2011 at 8:24 PM, Calvin Spealman 
>>> wrote:

 They are completely unrelated. WX is a library for working with
 desktop-based UI toolkits, and Django is a framework for producing and
 delivering HTML/CSS/JS web content to a browser.

 On Wed, Mar 30, 2011 at 10:03 PM, Aref  wrote:
 > Hello,
 >
 > I have created a small app with wxpython to manage and query databases
 > and now I am learning django and was wondering if it is possible to
 > incorporate some of the wxpython code in django. What I am trying to
 > do is to create the same app as the one in wxpython but make it web-
 > based rather than desktop. I know the django admin does that but I
 > wanted to learn how to create web based apps and thought that would be
 > a good exercise. Thanks for any pointers or ideas.
 >
 > --
 > You received this message because you are subscribed to the Google
 > Groups "Django users" group.
 > To post to this group, send email to django-users@googlegroups.com.
 > To unsubscribe from this group, send email to
 > django-users+unsubscr...@googlegroups.com.
 > For more options, visit this group at
 > http://groups.google.com/group/django-users?hl=en.
 >
 >



 --
 Read my blog! I depend on your acceptance of my opinion! I am
 interesting!
 http://techblog.ironfroggy.com/
 Follow me if you're into that sort of thing:
 http://www.twitter.com/ironfroggy
>>>
>>>
>>
>>
>>
>> --
>> Read my blog! I depend on your acceptance of my opinion! I am interesting!
>> http://techblog.ironfroggy.com/
>> Follow me if you're into that sort of thing:
>> http://www.twitter.com/ironfroggy
>>
>



-- 
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://techblog.ironfroggy.com/
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Serve a tracking pixel via Django

2011-03-31 Thread Russell Keith-Magee
On Fri, Apr 1, 2011 at 8:09 AM, Adam Nelson  wrote:
> We have one static file that needs to be served after business logic has run
> (i.e. log a view on a specific url based on a unique code).  We used to use
> serve() in production.  This has always been frowned upon but with Django
> 1.3, the errors are worse.

Errors or warnings? There's a big difference. Errors mean it isn't
working. Warnings mean it is working, but something is telling you to
pay attention to something.

> Can one return an image in any other way?

Sure. Write a view that returns the content. It's 3 lines of code (a
couple more if you count imports and whitespace). Added bonus -- it's
actually more efficient than serve(), because it doesn't impose a disk
access overhead every time it gets called.

TRANSPARENT_1_PIXEL_GIF =
"\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\xff\xff\xff\x00\x00\x00\x21\xf9\x04\x01\x00\x00\x00\x00\x2c\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3b"

def tracking_pixel(request):
return HttpResponse(TRANSPARENT_1_PIXEL_GIF, content_type='image/gif')

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Serve a tracking pixel via Django

2011-03-31 Thread Adam Nelson
We have one static file that needs to be served after business logic has run 
(i.e. log a view on a specific url based on a unique code).  We used to use 
serve() in production.  This has always been frowned upon but with Django 
1.3, the errors are worse.  Can one return an image in any other way?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DjangoCon US 2011

2011-03-31 Thread Steve Holden
I have already started nagging people about this. It's only just over five
months to go, and it's definitely time the CfP went out. Expect to see
movement in the next two weeks.

Regards
Steve
On Mar 31, 2011 6:19 PM, "Shawn Milochik"  wrote:
> It's a bit early, in the year, but I'd expect something in the next
> couple of months here:
>
> http://djangocon.us/
>
> Since it's not till September there's still plenty of time.
>
> That said, if @holdenweb is reading this -- any updates? ^_^
>
> Shawn
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Strange admin changelist bug with list_editable and FK to User in 1.2.3

2011-03-31 Thread Karen Tracey
On Thu, Mar 31, 2011 at 3:35 PM, Nan  wrote:

> Any idea what might be going on?  I'm using 1.2.3 at the moment, and
> the client doesn't want to authorize the work to upgrade to 1.3 just
> yet, so I can't determine whether it's version-specific.
>

Sounds rather like:

http://code.djangoproject.com/ticket/12475

which is fixed in 1.3.

Karen
-- 
http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DjangoCon US 2011

2011-03-31 Thread Shawn Milochik
It's a bit early, in the year, but I'd expect something in the next
couple of months here:

http://djangocon.us/

Since it's not till September there's still plenty of time.

That said, if @holdenweb is reading this -- any updates?  ^_^

Shawn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: south for django

2011-03-31 Thread Jason Culverhouse

On Mar 31, 2011, at 1:18 PM, jay K. wrote:

> 
> I think i found the source of all problems
> 
> I am not a python expert, so I was wondering if anybody can tell me what this 
> code means
> 
> // beginning of code
> 
> from django.db import models
> 
> 
> class TranslationForeignKey(models.ForeignKey):
> """
> """
> pass
> 
> // end of code
> 
> This piece of code has been generating an error when executing the python 
> manage.py schemamigration myApp --initial command in South
> 
> If the above code has doesn't do anything, I will comment it out

See:
http://south.aeracode.org/docs/tutorial/part4.html#simple-inheritance

Add to the bottom of the file that defines TranslationForeignKey:
replace my_app.fields  with a that matches the definition
try:
from south.modelsinspector import add_introspection_rules
add_introspection_rules([], ['^my_app\.fields\.TranslationForeignKey'])
except ImportError:
pass

Jason


> 
> 
> On Thu, Mar 31, 2011 at 5:04 PM, jay K.  wrote:
> 
> Hello,
> 
> I've been using south to migrate a database
> 
> I followed all the commands to make the migrations in south (--initial and 
> --auto), all
> of this, after making my desired changes in modes.py
> 
> but when I refresh my page I still get a "Error 505" messages
> 
> I've checked spelling mistakes etc but found nothing
> 
> Any other suggestions would be great
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about url tag

2011-03-31 Thread Lic . José M . Rodriguez Bacallao
ok, thanks everyone

2011/3/31 Łukasz Rekucki :
> On 31 March 2011 18:50, Lic. José M. Rodriguez Bacallao
>  wrote:
>> well, I don't know if this is ok, but I solved the problem adding a
>> name='help_subject' tu the urlconf line
>
> Sorry, I couldn't answer earlier, but yes - that is exactly what you
> should do. Class-based views can't be referenced by using dot
> notation, so you must name them and reverse them by name.
>
> Django expects a string in form of ".". A
> class-based view is not a module, so it has no chance of success. Even
> if it somehow was able to get the as_view method from the class, there
> is no way to tell to which URL it was bound (look at how as_view()
> works for more details).
>
> Naming all your URLs is a good practice anyway.
>
> --
> Łukasz Rekucki
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: south for django

2011-03-31 Thread jay K.
I think i found the source of all problems

I am not a python expert, so I was wondering if anybody can tell me what
this code means

// beginning of code

*from django.db import models


class TranslationForeignKey(models.ForeignKey):
"""
"""
pass
*
// end of code

This piece of code has been generating an error when executing the *python
manage.py schemamigration myApp --initial* command in South

If the above code has doesn't do anything, I will comment it out



On Thu, Mar 31, 2011 at 5:04 PM, jay K.  wrote:

>
> Hello,
>
> I've been using south to migrate a database
>
> I followed all the commands to make the migrations in south (--initial and
> --auto), all
> of this, after making my desired changes in modes.py
>
> but when I refresh my page I still get a "Error 505" messages
>
> I've checked spelling mistakes etc but found nothing
>
> Any other suggestions would be great
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DjangoCon US 2011

2011-03-31 Thread Micah Carrick
I was wondering about that too seeing as how I live in Portland.

On Thu, Mar 31, 2011 at 11:49 AM, Vinicius Mendes wrote:

> Hi, I am planing to go to DjangoCon US 2011 announced in this blog post:
> http://www.djangoproject.com/weblog/2010/nov/22/djangocon-us-2011/ but
> it's an old post and I haven't seen any other posts about it since this
> announcement. Will this event take place? Or it will be only the DjangoCon
> Europe?
>
> Atenciosamente,
> Vinicius Mendes
> Engenheiro de Computação
> Globo.com
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



south for django

2011-03-31 Thread jay K.
Hello,

I've been using south to migrate a database

I followed all the commands to make the migrations in south (--initial and
--auto), all
of this, after making my desired changes in modes.py

but when I refresh my page I still get a "Error 505" messages

I've checked spelling mistakes etc but found nothing

Any other suggestions would be great

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: south for django

2011-03-31 Thread jay K.
that's weird, because I keep getting the same error

the field that I'm using is not custom (models.TextField)

it may be located somewhere else


On Thu, Mar 31, 2011 at 4:47 PM, Shawn Milochik  wrote:

> You don't need that inspection feature for fields known to Django. Just
> custom types.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: south for django

2011-03-31 Thread Shawn Milochik
You don't need that inspection feature for fields known to Django. Just
custom types.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: south for django

2011-03-31 Thread jay K.
All I did to change my models.py, was to add the following line

*map_text = models.TextField( 'Map text', blank = True, null = False,
help_text = 'text on the subpage "map"')*

As you can see, I intend to add a new text area in my models.py

At the bottom of the page, I type this code

*from south.modelsinspector import add_introspection_rules
add_introspection_rules([], ["^destinations\.map_text"])*

The name of my application is "destinations" and the new field is called
"map_text"

Unfortunately it stills gives me the same error message


On Thu, Mar 31, 2011 at 4:37 PM, Shawn Milochik  wrote:

> Are you typing your app name in camelCase? Try all-lower.
>
> Are you using any model field types other than the ones that come with
> Django?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: idiotic foreignkey error

2011-03-31 Thread Nick
I needed to declare fk_name in the inline formsets.

I still stand by the fact that it's an idiotic error message. Not
helpful at all.

On Mar 31, 2:26 pm, Nick  wrote:
> sorry, they have unique names. When i was writing this message out I
> messed them up. the names are arace, brace and crace.
>
> I think this has something to do with some relic inlinde formsets I
> was using a while ago.
>
> On Mar 31, 2:19 pm, Shawn Milochik  wrote:
>
> > They need unique related_name values.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: south for django

2011-03-31 Thread Shawn Milochik
Are you typing your app name in camelCase? Try all-lower.

Are you using any model field types other than the ones that come with
Django?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Strange admin changelist bug with list_editable and FK to User in 1.2.3

2011-03-31 Thread Nan
Hi folks...

I've got a model that looks roughly like so:

class Account(admin.ModelAdmin):
type = models.ForeignKey(AccountType, help_text='Type of account.
Determines what features are available to the user.')
user = models.ForeignKey(User, unique=True, primary_key=True)
design = models.ForeignKey(Skin, blank=True, null=True)


And a ModelAdmin that looks like so:

class AccountAdmin(admin.ModelAdmin):
list_display = ['__unicode__', 'user', 'type', 'design', ...]
list_editable = ['type', 'design', ...]

The User column is showing up blank in the admin changelist
(containing nothing but a hidden form field).  I've tried eliminating
other options on the AccountAdmin, changing field order, and narrowed
it down to some sort of odd interaction with list_editable.
Commenting out the list_editable property entirely fixes the problem,
but any value (even an empty list) for list_editable that does not
include 'user' causes the problem to recur.

Any idea what might be going on?  I'm using 1.2.3 at the moment, and
the client doesn't want to authorize the work to upgrade to 1.3 just
yet, so I can't determine whether it's version-specific.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



south for django

2011-03-31 Thread jay K.
hello,

I've downloaded and installed south successfully to manage changes
with my models.py file

I type the following command

*python manage.py schemamigration myApp --auto*

then, get the following message

*You cannot use --auto on an app with no migrations. Try --initial.*

So I do as stated, with the command: *python manage.py schemamigration myApp
--initial*, but get the following message:

*Cannot freeze field*

what's wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: idiotic foreignkey error

2011-03-31 Thread Nick
sorry, they have unique names. When i was writing this message out I
messed them up. the names are arace, brace and crace.

I think this has something to do with some relic inlinde formsets I
was using a while ago.

On Mar 31, 2:19 pm, Shawn Milochik  wrote:
> They need unique related_name values.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: idiotic foreignkey error

2011-03-31 Thread Shawn Milochik
They need unique related_name values.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



idiotic foreignkey error

2011-03-31 Thread Nick
I have a model with 3 foreignkeys to another model. This has never
been an issue for me before but now it's throwing an error:

 has more than 1
ForeignKey to 

My model looks like this:

a_race = models.ForeignKey('Race', related_name='arace', blank=True)
b_race = models.ForeignKey('Race', related_name='arace', blank=True)
c_race = models.ForeignKey('Race', related_name='arace', blank=True):

I must reiterate that this has never been a problem for me before.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Change the Queryset order to add "Other" at the end

2011-03-31 Thread Álex González
Hi!

I don't know if this is the best way to do it (change the QuerySet), but I
have a model order by name, and when I use it as a foreign key () I
want to write "Other" as the last  to choose.

Regards,
Álex Gonzálkez

-- 
@agonzalezro 
Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt
and/or .pptx

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



DjangoCon US 2011

2011-03-31 Thread Vinicius Mendes
Hi, I am planing to go to DjangoCon US 2011 announced in this blog post:
http://www.djangoproject.com/weblog/2010/nov/22/djangocon-us-2011/ but it's
an old post and I haven't seen any other posts about it since this
announcement. Will this event take place? Or it will be only the DjangoCon
Europe?

Atenciosamente,
Vinicius Mendes
Engenheiro de Computação
Globo.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Dynamically generating form fields

2011-03-31 Thread Andre Terra
I've been fighting to get this to work for me to. I can point you to a few
articles that are helping me achieve what I want. There's some black magic
involved, but once you play with the code for a while you'll know what it
does.

http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/
http://dougalmatthews.com/articles/2009/dec/16/nicer-dynamic-forms-django/
http://www.slideshare.net/kingkilr/forms-getting-your-moneys-worth
http://uswaretech.com/blog/2010/01/doing-things-with-django-forms/

These are some VERY good links with info that should definitely be included
in the docs. Good luck and I apologize for not answering sooner. My use case
is different from yours, so pasting my code probably won't be that useful to
you.


Cheers,
André Terra

On Mon, Mar 28, 2011 at 11:32 AM, fersan  wrote:

> Hello,
>
> I am trying to create a form with fields based on types of an object
> property. Basically, I am setting up a system which has hardware
> 'demos' which are categorized by industry. I want to create a form
> which has a Checkbox Select Multiple for each industry, with the
> choices being the demos for that industry. Currently, my (un-working)
> form code looks like:
>
> class select_demo_apps_frm(forms.Form):
> # List apps from each industry with selection boxes for each app.
>def __init__(self, *args, **kwargs):
>super(select_demo_apps_frm, self).__init__(*args, **kwargs)
>
>inds = industries() # returns all industry objects
>
>for ind in inds:
>fieldname = '%s' % ind.name
>self.fields[fieldname] = forms.CheckboxSelectMultiple()
>self.fields[fieldname].choices = [(d.id, marksafe('%s b> - %s') % (d.name, d.desc)) for d in demo.objects.filter(industry =
> ind)]
>
> Unfortunately, I'm getting an error from this code:
>
> Error when calling the metaclass bases
>Cannot create a consistent method resolution
> order (MRO) for bases Form, select_demo_apps_frm
>
> It could be possible to set a static field for each industry, however
> in the interest of long term maintainability I'd rather do it
> dynamically in case new industries get added after I leave this job.
> Just wondering if anyone can help with creating this form in such a
> way that it actually works ;)
>
> Thanks much!
>
> Fernando Sanchez
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: new text area in django admin page

2011-03-31 Thread jay K.
thanks, it works fine!!

I can't believe I spent 2 days trying to sort out my database issues

greatly appreciate your advice :)

On Thu, Mar 31, 2011 at 3:04 PM, Shawn Milochik  wrote:

>
> On Mar 31, 2011 1:55 PM, "jay K."  wrote:
> >
> > Thanks for the advice,
> >
> > But I am not exactly migrating databases, just modifying an existing one
> >
> >
> And that's exactly what South is for.
>
> > On Thu, Mar 31, 2011 at 2:50 PM, Shawn Milochik 
> wrote:
> >>
> >> On Thu, Mar 31, 2011 at 1:39 PM, jay K. 
> wrote:
> >>
> >> 
> >> >
> >> >
> >> > So what am I doing wrong?
> >> >
> >>
> >> Use South for your database migrations:
> >> http://south.aeracode.org/
> >>
> >> Otherwise you have to write raw SQL statements to modify the database,
> >> or delete the entire database and use syncdb to re-create it to match
> >> you model.
> >>
> >> I think South is the best of those options.
> >>
> >> Shawn
> >>
> >> --
> >>
> >> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> >> To post to this group, send email to django-users@googlegroups.com.
> >> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: new text area in django admin page

2011-03-31 Thread Shawn Milochik
On Mar 31, 2011 1:55 PM, "jay K."  wrote:
>
> Thanks for the advice,
>
> But I am not exactly migrating databases, just modifying an existing one
>
>
And that's exactly what South is for.

> On Thu, Mar 31, 2011 at 2:50 PM, Shawn Milochik 
wrote:
>>
>> On Thu, Mar 31, 2011 at 1:39 PM, jay K. 
wrote:
>>
>> 
>> >
>> >
>> > So what am I doing wrong?
>> >
>>
>> Use South for your database migrations:
>> http://south.aeracode.org/
>>
>> Otherwise you have to write raw SQL statements to modify the database,
>> or delete the entire database and use syncdb to re-create it to match
>> you model.
>>
>> I think South is the best of those options.
>>
>> Shawn
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
"Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: new text area in django admin page

2011-03-31 Thread jay K.
Thanks for the advice,

But I am not exactly migrating databases, just modifying an existing one


On Thu, Mar 31, 2011 at 2:50 PM, Shawn Milochik  wrote:

> On Thu, Mar 31, 2011 at 1:39 PM, jay K. 
> wrote:
>
> 
> >
> >
> > So what am I doing wrong?
> >
>
> Use South for your database migrations:
> http://south.aeracode.org/
>
> Otherwise you have to write raw SQL statements to modify the database,
> or delete the entire database and use syncdb to re-create it to match
> you model.
>
> I think South is the best of those options.
>
> Shawn
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: new text area in django admin page

2011-03-31 Thread Shawn Milochik
On Thu, Mar 31, 2011 at 1:39 PM, jay K.  wrote:


>
>
> So what am I doing wrong?
>

Use South for your database migrations:
http://south.aeracode.org/

Otherwise you have to write raw SQL statements to modify the database,
or delete the entire database and use syncdb to re-create it to match
you model.

I think South is the best of those options.

Shawn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: new text area in django admin page

2011-03-31 Thread jay K.
that right, I've provided a very vague question

I have to modify an existing models.py file. What I basically want to do is
to add
a new Text Area in the django admin page so I can add a new subpage.

Here is what I do step by step

1) I open models.py and insert the following code:

// start of code

*class City( models.Model ):

   
   class Translation (multilingual.Translation):
 ...
 climate_text = models.TextField ( 'Climate text', blank = True,
null = False, help_text = 'text on the subpage "clima"' )
 map_text = models.TextField( 'Map text', blank = True, null =
False, help_text = 'text on the subpage "map"')
*

// end of code

The code in bold and italics is the text area I want to add to my models.py.

Then, I update my database by executing the following code:

python manage.py sql *my-application*

However, when I refresh my website, I get an *Error 505. *This error appears
only in the pages that use
the models.py file I've modified, so the rest of the website works fine.

So what am I doing wrong?

Thanks



On Thu, Mar 31, 2011 at 11:58 AM, Daniel Roseman wrote:

> On Thursday, March 31, 2011 3:35:15 PM UTC+1, jay K. wrote:
>>
>> hello
>>
>> how can i add a new text field in the django admin area
>>
>> i want to create a new subpage
>>
>> thanks
>>
>>
>>
> Before asking a question, have a think about what you actually want to ask.
> Then think about whether you're providing all the information needed for
> anyone to answer the question. Now look at what you've written. Do you
> seriously, honestly think that anyone will have the remotest idea what
> you're asking, or be able to even start answering you?
>
> Now try again.
> --
> DR.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about url tag

2011-03-31 Thread Łukasz Rekucki
On 31 March 2011 18:50, Lic. José M. Rodriguez Bacallao
 wrote:
> well, I don't know if this is ok, but I solved the problem adding a
> name='help_subject' tu the urlconf line

Sorry, I couldn't answer earlier, but yes - that is exactly what you
should do. Class-based views can't be referenced by using dot
notation, so you must name them and reverse them by name.

Django expects a string in form of ".". A
class-based view is not a module, so it has no chance of success. Even
if it somehow was able to get the as_view method from the class, there
is no way to tell to which URL it was bound (look at how as_view()
works for more details).

Naming all your URLs is a good practice anyway.

-- 
Łukasz Rekucki

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Dajax, what do you think about it?

2011-03-31 Thread LJ
My opinion would be to add it in.  But, I am not as experienced with
Dajaxice as others may be.  I just know it took me a long time to
figure out how to manually add it and get it working.
It wasn't until I learned how to use virtualenv that I was able to get
Dajaxice installed and working correctly.

On Mar 30, 10:55 pm, Sameer Rahmani  wrote:
> What do you think about using Dajax and Dajaxice in Django? is it worth? or
> you like to write your own ajax code?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about url tag

2011-03-31 Thread Micah Carrick
You have created a "Named URL pattern". Check out:
http://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns

On Thu, Mar 31, 2011 at 9:50 AM, Lic. José M. Rodriguez Bacallao <
jmr...@gmail.com> wrote:

> well, I don't know if this is ok, but I solved the problem adding a
> name='help_subject' tu the urlconf line
>
> On Thu, Mar 31, 2011 at 12:37 PM, Lic. José M. Rodriguez Bacallao
>  wrote:
> > sorry, I have atypo in the previous code, this is the las line:
> >
> > (r'(?P[0-9A-Za-z-]+)', HelpSubject.as_view()),
> >
> > On Thu, Mar 31, 2011 at 12:36 PM, Lic. José M. Rodriguez Bacallao
> >  wrote:
> >> I am getting a this error:
> >> TemplateSyntaxError at /help/
> >>
> >> Caught NoReverseMatch while rendering: Reverse for
> >> 'apps.help.views.HelpSubject.as_view()' with arguments '()' and
> >> keyword arguments '{'slug': u'gdsgdgdg'}' not found.
> >>
> >> On Thu, Mar 31, 2011 at 12:33 PM, Lic. José M. Rodriguez Bacallao
> >>  wrote:
> >>> I mean url tag: {% url ... %}
> >>>
> >>> this is what I am using: Leer
> >>> mas...
> >>>
> >>> directory structure:
> >>>
> >>> site
> >>>  |--> url.py
> >>>  |--> apps (included in the python path)
> >>>|--> help
> >>>   |--> models.py
> >>>   |--> views.py
> >>>   |--> urls.py
> >>>
> >>> where:
> >>> "apps" is a package (is in the python path)
> >>> "help" is my application
> >>> "HelpSubject" is a class based view, here is the definition:
> >>>
> >>>
> >>> class HelpSubject(DetailView):
> >>>template_name = 'help/help_subject.html'
> >>>context_object_name = 'help_subject'
> >>>queryset = HelpSubject.objects.filter(published=True)
> >>>
> >>> and here is the two lines in url.py and apps/help/url.py
> >>>
> >>> url.py:
> >>> (r'^help/', include('help.urls')),
> >>>
> >>> apps/help/url.py:
> >>> (r'(?P[0-9A-Za-z-]+)', help.HelpSubject.as_view,
> >>>
> >>> 2011/3/31 Łukasz Rekucki :
>  On 31 March 2011 17:16, Lic. José M. Rodriguez Bacallao
>   wrote:
> > use the tag:
> > url
> 
>  What do you mean by that ? Do you mean the {% url %} template tag, or
>  the `url` function commonly used in urls.py module. Give us some
>  examples of what you want to achieve and what problems you have.
>  --
>  Łukasz Rekucki
> 
>  --
>  You received this message because you are subscribed to the Google
> Groups "Django users" group.
>  To post to this group, send email to django-users@googlegroups.com.
>  To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
>  For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> 
> 
> >>>
> >>>
> >>>
> >>> --
> >>> Lic. José M. Rodriguez Bacallao
> >>> Centro de Biofisica Medica
> >>> -
> >>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
> mismo.
> >>>
> >>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> >>> por profesionales
> >>> -
> >>>
> >>
> >>
> >>
> >> --
> >> Lic. José M. Rodriguez Bacallao
> >> Centro de Biofisica Medica
> >> -
> >> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
> mismo.
> >>
> >> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> >> por profesionales
> >> -
> >>
> >
> >
> >
> > --
> > Lic. José M. Rodriguez Bacallao
> > Centro de Biofisica Medica
> > -
> > Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
> mismo.
> >
> > Recuerda: El arca de Noe fue construida por aficionados, el titanic
> > por profesionales
> > -
> >
>
>
>
> --
> Lic. José M. Rodriguez Bacallao
> Centro de Biofisica Medica
> -
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
> mismo.
>
> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> por profesionales
> -
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
*Green Tackle* - *Environmentally Friendly Fishing Tackle*
www.GreenTackle.com 

 Email: mi...@greentackle.com
 Phone: 

Screen Fields and Dropdowns Not Capturing Changes To Data on Edit Screen

2011-03-31 Thread hank23
I have a screen with a form on it and the text fields values and the
dropdown box selected values that are changed do not appear to be
posted back to the view. How is this possible? When I go to the screen
originally I see all of the data that supposed to be there (often
times much of it is from the previous screen). But when I physically
go in and touch any of the text fields or select a different entry
from a dropdown, the values which appear to be posted  back to the
view are still the original values that the screen was originally
displayed with.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: I want Develop django poll app tuturial

2011-03-31 Thread cha
thanx 

I have Reached the following

total_poll_votes = sum(c.votes for c in p.choice_set.all())
poll_votes = ?? 
vote_percentage = (poll_votes/total_poll_votes)*100

i just need poll_votes

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: authentication switching mid-session

2011-03-31 Thread Chris Curvey
there's no cacheing in front of the application server, if that's what 
you're asking.  The app server does do some cacheing on its own, but not 
related to sessions or users.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about url tag

2011-03-31 Thread Lic . José M . Rodriguez Bacallao
well, I don't know if this is ok, but I solved the problem adding a
name='help_subject' tu the urlconf line

On Thu, Mar 31, 2011 at 12:37 PM, Lic. José M. Rodriguez Bacallao
 wrote:
> sorry, I have atypo in the previous code, this is the las line:
>
> (r'(?P[0-9A-Za-z-]+)', HelpSubject.as_view()),
>
> On Thu, Mar 31, 2011 at 12:36 PM, Lic. José M. Rodriguez Bacallao
>  wrote:
>> I am getting a this error:
>> TemplateSyntaxError at /help/
>>
>> Caught NoReverseMatch while rendering: Reverse for
>> 'apps.help.views.HelpSubject.as_view()' with arguments '()' and
>> keyword arguments '{'slug': u'gdsgdgdg'}' not found.
>>
>> On Thu, Mar 31, 2011 at 12:33 PM, Lic. José M. Rodriguez Bacallao
>>  wrote:
>>> I mean url tag: {% url ... %}
>>>
>>> this is what I am using: Leer
>>> mas...
>>>
>>> directory structure:
>>>
>>> site
>>>  |--> url.py
>>>  |--> apps (included in the python path)
>>>        |--> help
>>>               |--> models.py
>>>               |--> views.py
>>>               |--> urls.py
>>>
>>> where:
>>> "apps" is a package (is in the python path)
>>> "help" is my application
>>> "HelpSubject" is a class based view, here is the definition:
>>>
>>>
>>> class HelpSubject(DetailView):
>>>    template_name = 'help/help_subject.html'
>>>    context_object_name = 'help_subject'
>>>    queryset = HelpSubject.objects.filter(published=True)
>>>
>>> and here is the two lines in url.py and apps/help/url.py
>>>
>>> url.py:
>>> (r'^help/', include('help.urls')),
>>>
>>> apps/help/url.py:
>>> (r'(?P[0-9A-Za-z-]+)', help.HelpSubject.as_view,
>>>
>>> 2011/3/31 Łukasz Rekucki :
 On 31 March 2011 17:16, Lic. José M. Rodriguez Bacallao
  wrote:
> use the tag:
> url

 What do you mean by that ? Do you mean the {% url %} template tag, or
 the `url` function commonly used in urls.py module. Give us some
 examples of what you want to achieve and what problems you have.
 --
 Łukasz Rekucki

 --
 You received this message because you are subscribed to the Google Groups 
 "Django users" group.
 To post to this group, send email to django-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 django-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/django-users?hl=en.


>>>
>>>
>>>
>>> --
>>> Lic. José M. Rodriguez Bacallao
>>> Centro de Biofisica Medica
>>> -
>>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo 
>>> mismo.
>>>
>>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
>>> por profesionales
>>> -
>>>
>>
>>
>>
>> --
>> Lic. José M. Rodriguez Bacallao
>> Centro de Biofisica Medica
>> -
>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
>>
>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
>> por profesionales
>> -
>>
>
>
>
> --
> Lic. José M. Rodriguez Bacallao
> Centro de Biofisica Medica
> -
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
>
> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> por profesionales
> -
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about url tag

2011-03-31 Thread Lic . José M . Rodriguez Bacallao
sorry, I have atypo in the previous code, this is the las line:

(r'(?P[0-9A-Za-z-]+)', HelpSubject.as_view()),

On Thu, Mar 31, 2011 at 12:36 PM, Lic. José M. Rodriguez Bacallao
 wrote:
> I am getting a this error:
> TemplateSyntaxError at /help/
>
> Caught NoReverseMatch while rendering: Reverse for
> 'apps.help.views.HelpSubject.as_view()' with arguments '()' and
> keyword arguments '{'slug': u'gdsgdgdg'}' not found.
>
> On Thu, Mar 31, 2011 at 12:33 PM, Lic. José M. Rodriguez Bacallao
>  wrote:
>> I mean url tag: {% url ... %}
>>
>> this is what I am using: Leer
>> mas...
>>
>> directory structure:
>>
>> site
>>  |--> url.py
>>  |--> apps (included in the python path)
>>        |--> help
>>               |--> models.py
>>               |--> views.py
>>               |--> urls.py
>>
>> where:
>> "apps" is a package (is in the python path)
>> "help" is my application
>> "HelpSubject" is a class based view, here is the definition:
>>
>>
>> class HelpSubject(DetailView):
>>    template_name = 'help/help_subject.html'
>>    context_object_name = 'help_subject'
>>    queryset = HelpSubject.objects.filter(published=True)
>>
>> and here is the two lines in url.py and apps/help/url.py
>>
>> url.py:
>> (r'^help/', include('help.urls')),
>>
>> apps/help/url.py:
>> (r'(?P[0-9A-Za-z-]+)', help.HelpSubject.as_view,
>>
>> 2011/3/31 Łukasz Rekucki :
>>> On 31 March 2011 17:16, Lic. José M. Rodriguez Bacallao
>>>  wrote:
 use the tag:
 url
>>>
>>> What do you mean by that ? Do you mean the {% url %} template tag, or
>>> the `url` function commonly used in urls.py module. Give us some
>>> examples of what you want to achieve and what problems you have.
>>> --
>>> Łukasz Rekucki
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>>
>>
>>
>>
>> --
>> Lic. José M. Rodriguez Bacallao
>> Centro de Biofisica Medica
>> -
>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
>>
>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
>> por profesionales
>> -
>>
>
>
>
> --
> Lic. José M. Rodriguez Bacallao
> Centro de Biofisica Medica
> -
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
>
> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> por profesionales
> -
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about url tag

2011-03-31 Thread Lic . José M . Rodriguez Bacallao
I am getting a this error:
TemplateSyntaxError at /help/

Caught NoReverseMatch while rendering: Reverse for
'apps.help.views.HelpSubject.as_view()' with arguments '()' and
keyword arguments '{'slug': u'gdsgdgdg'}' not found.

On Thu, Mar 31, 2011 at 12:33 PM, Lic. José M. Rodriguez Bacallao
 wrote:
> I mean url tag: {% url ... %}
>
> this is what I am using: Leer
> mas...
>
> directory structure:
>
> site
>  |--> url.py
>  |--> apps (included in the python path)
>        |--> help
>               |--> models.py
>               |--> views.py
>               |--> urls.py
>
> where:
> "apps" is a package (is in the python path)
> "help" is my application
> "HelpSubject" is a class based view, here is the definition:
>
>
> class HelpSubject(DetailView):
>    template_name = 'help/help_subject.html'
>    context_object_name = 'help_subject'
>    queryset = HelpSubject.objects.filter(published=True)
>
> and here is the two lines in url.py and apps/help/url.py
>
> url.py:
> (r'^help/', include('help.urls')),
>
> apps/help/url.py:
> (r'(?P[0-9A-Za-z-]+)', help.HelpSubject.as_view,
>
> 2011/3/31 Łukasz Rekucki :
>> On 31 March 2011 17:16, Lic. José M. Rodriguez Bacallao
>>  wrote:
>>> use the tag:
>>> url
>>
>> What do you mean by that ? Do you mean the {% url %} template tag, or
>> the `url` function commonly used in urls.py module. Give us some
>> examples of what you want to achieve and what problems you have.
>> --
>> Łukasz Rekucki
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
>
> --
> Lic. José M. Rodriguez Bacallao
> Centro de Biofisica Medica
> -
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
>
> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> por profesionales
> -
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about url tag

2011-03-31 Thread Lic . José M . Rodriguez Bacallao
I mean url tag: {% url ... %}

this is what I am using: Leer
mas...

directory structure:

site
  |--> url.py
  |--> apps (included in the python path)
|--> help
   |--> models.py
   |--> views.py
   |--> urls.py

where:
"apps" is a package (is in the python path)
"help" is my application
"HelpSubject" is a class based view, here is the definition:


class HelpSubject(DetailView):
template_name = 'help/help_subject.html'
context_object_name = 'help_subject'
queryset = HelpSubject.objects.filter(published=True)

and here is the two lines in url.py and apps/help/url.py

url.py:
(r'^help/', include('help.urls')),

apps/help/url.py:
(r'(?P[0-9A-Za-z-]+)', help.HelpSubject.as_view,

2011/3/31 Łukasz Rekucki :
> On 31 March 2011 17:16, Lic. José M. Rodriguez Bacallao
>  wrote:
>> use the tag:
>> url
>
> What do you mean by that ? Do you mean the {% url %} template tag, or
> the `url` function commonly used in urls.py module. Give us some
> examples of what you want to achieve and what problems you have.
> --
> Łukasz Rekucki
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: check for existence in bulk

2011-03-31 Thread dmitry b
thanks, that's what I ended up using.

On Mar 30, 11:58 am, Jason Culverhouse  wrote:

> You could use values_list  and flat as in:
>
>    User.objects.filter(username__in =['jason', 'was', 
> 'here']).values_list('username', flat=True)
>
> returns a list:
>
>    [u'jason', u'was']
>
> After that you can figure out the best way to perform the lookup.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about url tag

2011-03-31 Thread Łukasz Rekucki
On 31 March 2011 17:16, Lic. José M. Rodriguez Bacallao
 wrote:
> use the tag:
> url

What do you mean by that ? Do you mean the {% url %} template tag, or
the `url` function commonly used in urls.py module. Give us some
examples of what you want to achieve and what problems you have.
-- 
Łukasz Rekucki

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



about url tag

2011-03-31 Thread Lic . José M . Rodriguez Bacallao
hi folks, I was using django 1.2.5 and generic views to some simple
things, now, I upgrade to django 1.3 and I am trying to use the tag:
url but it doesn't seems to work with django class based generic
views. How to use this tag correctly?

-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: staticfile app question

2011-03-31 Thread Javier Guerra Giraldez
On Thu, Mar 31, 2011 at 9:55 AM, Micah Carrick  wrote:
> IMO, relative URLs are preferable in external stylesheets.

+1

-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: new text area in django admin page

2011-03-31 Thread Daniel Roseman
On Thursday, March 31, 2011 3:35:15 PM UTC+1, jay K. wrote:
>
> hello
>
> how can i add a new text field in the django admin area
>
> i want to create a new subpage 
>
> thanks
>
>
>
Before asking a question, have a think about what you actually want to ask. 
Then think about whether you're providing all the information needed for 
anyone to answer the question. Now look at what you've written. Do you 
seriously, honestly think that anyone will have the remotest idea what 
you're asking, or be able to even start answering you?

Now try again.
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: staticfile app question

2011-03-31 Thread Micah Carrick
I had to look up "grok". Guess I'm out of the loop.

Anyway, one other pitfall with using absolute URLs in CSS is that you can
break SSL (https) when you have common CSS for both the SSL and non-SSL
pages. So watch out for that. IMO, relative URLs are preferable in external
stylesheets. In fact, that has been a firm rule in most projects I've been
involved with.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: I want Develop django poll app tuturial

2011-03-31 Thread Sithembewena Lloyd Dube
^^ This would apply per poll.

On Thu, Mar 31, 2011 at 4:50 PM, Sithembewena Lloyd Dube
wrote:

> Hi there,
>
> I think that you would need to get the count of votes for each poll, add
> all votes and use the formula:
>
> vote_percentage = (poll_votes/total_poll_votes)*100
>
>
>
> On Thu, Mar 31, 2011 at 8:33 AM, cha  wrote:
>
>> ok in beginning
>> how i can get percentage for each vote ?
>>
>> this result code
>>
>> def results(request, poll_id):
>>
>> p = get_object_or_404(Poll, pk=poll_id)
>> return render_to_response('polls/results.html', {'poll': p})
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Regards,
> Sithembewena Lloyd Dube
>



-- 
Regards,
Sithembewena Lloyd Dube

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: I want Develop django poll app tuturial

2011-03-31 Thread Sithembewena Lloyd Dube
Hi there,

I think that you would need to get the count of votes for each poll, add all
votes and use the formula:

vote_percentage = (poll_votes/total_poll_votes)*100


On Thu, Mar 31, 2011 at 8:33 AM, cha  wrote:

> ok in beginning
> how i can get percentage for each vote ?
>
> this result code
>
> def results(request, poll_id):
> p = get_object_or_404(Poll, pk=poll_id)
> return render_to_response('polls/results.html', {'poll': p})
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Regards,
Sithembewena Lloyd Dube

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



new text area in django admin page

2011-03-31 Thread jay K.
hello

how can i add a new text field in the django admin area

i want to create a new subpage

thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Hi multilingual charfields?

2011-03-31 Thread Stuart MacKay
One more vote for django-transmeta, 
http://code.google.com/p/django-transmeta/, it's really simply to use. I 
have used in a project for names and small sections of text. The admin 
integration is nice as it allows you to view the fields side-by-side so 
it makes the process of translation easy to do.


Stuart

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



EuroPython 2011: call for paper is ending - Please spread the word

2011-03-31 Thread Palla
Hi all Django users,
I'm Francesco and I am writing on behalf of "Python Italia APS", a no-
profit association promoting EuroPython conference.
(www.europython.eu)

Europython End of Call for Presentations is April 6th. I'd like to ask
to you to forward this mail to anyone that you feel may be interested.

We're looking for proposals on every aspects of Python: programming
from novice to advanced levels, applications and frameworks, or how
you have been involved in introducing Python into your organisation.

**First-time speakers are especially welcome**; EuroPython is a
community conference and we are eager to hear about your experience.
If you have friends or colleagues who have something valuable to
contribute, twist their arms to tell us about it!


Presenting at EuroPython

We will accept a broad range of presentations, from reports on
academic and commercial projects to tutorials and case studies. As
long as the presentation is interesting and potentially useful to the
Python community, it will be considered for inclusion in the
programme.

Can you show the conference-goers something new and useful? Can you
show attendees how to: use a module? Explore a Python language
feature? Package an application? If so, consider submitting a talk.


Talks and hands-on trainings

There are two different kind of presentations that you can give as a
speaker at EuroPython:

 * **Regular talk**. These are standard "talk with slides", allocated
in slots of 45, 60 or 90 minutes, depending on your preference and
scheduling constraints. A Q session is held at the end of the talk.
 * **Hands-on training**. These are advanced training sessions for a
smaller audience (10-20 people), to dive into the subject with all
details. These sessions are 4-hours long, and audience will be
strongly encouraged to bring a laptop to experiment. They should be
prepared with less slides and more source code. If possible, trainers
will also give a short "teaser talk" of 30 minutes the day before the
training, to tease delegates into attending the training.

In the talk submission form, we assume that you intend to give a
regular talk on the subject, but you will be asked if you are
available for also doing a hands-on training on the very same subject.

Speakers that will give a hands-on training are rewarded with a **free
entrance** to EuroPython to compensate for the longer preparation
required, and might also be eligible for a speaking fee (which we
cannot confirm at the moment).

Topics and goals

Specific topics for EuroPython presentations include, but are not
limited to:

- Core Python
- Other implementations: Jython, IronPython, PyPy, and Stackless
- Python libraries and extensions
- Python 3.x migration
- Databases
- Documentation
- GUI Programming
- Game Programming
- Network Programming
- Open Source Python projects
- Packaging Issues
- Programming Tools
- Project Best Practices
- Embedding and Extending
- Science and Math
- Web-based Systems

Presentation goals usually are some of the following:

- Introduce audience to a new topic they are unaware of
- Introduce audience to new developments on a well-known topic
- Show audience real-world usage scenarios for a specific topic (case
study)
- Dig into advanced and relatively-unknown details on a topic
- Compare different options in the market on a topic


Community-based talk voting
---
This year, for the first time in EuroPython history, the talk voting
process is fully public. Every partecipant gains the right to vote for
talks submitted during the Call For Papers, as soon as they commit to
their presence at the conference by buying a ticket. See all the
details in the talk voting[1] page.

Contacts

For any further question, feel free to contact the organizers at
i...@pycon.it. Thank you!

[1]: http://ep2011.europython.eu/talk-voting

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: wsgi configuration

2011-03-31 Thread george
the path should be:

path='/home/yongzhen/workspace/www'

for iStore.settings to resolve

On Mar 31, 1:40 pm, yongzhen zhang <4...@live.cn> wrote:
> Hi,
> I am using apache + wsgi for my Django project. But now i am a bit
> confused. The project is under /home/yongzhen/workspace/www . I put
> the apache folder under www, and it is same level with the project
> "iStore". i write django.wsgi inside apache like this:
> import os
> import sys
> path='/home/yongzhen/workspace/www/iStore'
> if path not in sys.path:
>     sys.path.append(path)
>
> wsgi_dir=os.path.abspath(os.path.dirname(__file__))
> project_dir=os.path.dirname(wsgi_dir)
> sys.path.append(project_dir)
> project_settings=os.path.join(project_dir,'settings')
> os.environ['DJANGO_SETTINGS_MODULE']='www.iStore.settings'
>
> import django.core.handlers.wsgi
> application=django.core.handlers.wsgi.WSGIHandler()
>
> But it does not work, the apache has the following error:
>  mod_wsgi (pid=11619): Exception occurred processing WSGI script '/
> home/yongzhen/workspace/www/apache/django.wsgi'.
>  Traceback (most recent call last):
>   File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
> wsgi.py", line 230, in __call__
>  self.load_middleware()
>    File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
> base.py", line 33, in load_middleware
>      for middleware_path in settings.MIDDLEWARE_CLASSES:
> File "/usr/local/lib/python2.6/dist-packages/django/utils/
> functional.py", line 276, in __getattr__
>      self._setup()
>    File "/usr/local/lib/python2.6/dist-packages/django/conf/
> __init__.py", line 40, in _setup
>     self._wrapped = Settings(settings_module)
>    File "/usr/local/lib/python2.6/dist-packages/django/conf/
> __init__.py", line 75, in __init__
>      raise ImportError("Could not import settings '%s' (Is it on
> sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
> e))
>  [error] [client 66.249.66.53] ImportError: Could not import settings
> 'iStore.settings' (Is it on sys.path? Does it have syntax errors?): No
> module named iStore.settings
>
> It seems that something wrong with
> "os.environ['DJANGO_SETTINGS_MODULE']='www.iStore.settings'", but it
> also does not work when i change it to
> os.environ['DJANGO_SETTINGS_MODULE']='iStore.settings'
> Anyone knows what is the problem?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: new subpage in django

2011-03-31 Thread Fatrix
Hi Jay

You could also have a look at [1] Stephen McDonald's Mezzanine.
Mezzanine is a CMS built using the django framework..
I am very happy with it.

[1] http://mezzanine.jupo.org/

On 30 Mrz., 21:16, "jay K."  wrote:
> Hello,
>
> How do you create a new subpage in django?
>
> thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: WxPython and django

2011-03-31 Thread Aref Nammari
Calvin,

The database as well as the django app sits on a server
(internal--this is not meant for public access by the general public).
To access the app users would have to login to the server through http
and run the app from there.

On 3/31/11, Calvin Spealman  wrote:
> Aref,
>
> The question I would have is where your database sits. Is it supposed
> to sit on a central server? In a website, your database only needs to
> be accessed by machine rendering the pages. If you want the same
> database talking to desktop applications, you need to let those apps
> talk to the database or run the database on individual users'
> machines. This is the part that concerns me, especially giving those
> users access to a central DB.
>
> On Thu, Mar 31, 2011 at 7:05 AM, Aref Nammari  wrote:
>> Thanks for the reply Calvin. I realize what django is about and what it is
>> meant for and I do understand what WxPython is capable of. I still think
>> that this does not prevent using wxpython as a frontend for django
>> app--instead of (or in conjunction with) HTML to render the page Iam
>> thinking that I should be able to use wxpython--pass the data to wxpython
>> module to display and take data from a form rendered with wxpython and
>> send
>> to django. This must doable I think.
>>
>> On Wed, Mar 30, 2011 at 8:24 PM, Calvin Spealman 
>> wrote:
>>>
>>> They are completely unrelated. WX is a library for working with
>>> desktop-based UI toolkits, and Django is a framework for producing and
>>> delivering HTML/CSS/JS web content to a browser.
>>>
>>> On Wed, Mar 30, 2011 at 10:03 PM, Aref  wrote:
>>> > Hello,
>>> >
>>> > I have created a small app with wxpython to manage and query databases
>>> > and now I am learning django and was wondering if it is possible to
>>> > incorporate some of the wxpython code in django. What I am trying to
>>> > do is to create the same app as the one in wxpython but make it web-
>>> > based rather than desktop. I know the django admin does that but I
>>> > wanted to learn how to create web based apps and thought that would be
>>> > a good exercise. Thanks for any pointers or ideas.
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups "Django users" group.
>>> > To post to this group, send email to django-users@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > django-users+unsubscr...@googlegroups.com.
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/django-users?hl=en.
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Read my blog! I depend on your acceptance of my opinion! I am
>>> interesting!
>>> http://techblog.ironfroggy.com/
>>> Follow me if you're into that sort of thing:
>>> http://www.twitter.com/ironfroggy
>>
>>
>
>
>
> --
> Read my blog! I depend on your acceptance of my opinion! I am interesting!
> http://techblog.ironfroggy.com/
> Follow me if you're into that sort of thing:
> http://www.twitter.com/ironfroggy
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to disable default authentication/messaging system?

2011-03-31 Thread sanderkrause
In addition to my last message, I have also tried specifying the apps
with the project name in front of it:

'uninspiring.auth'

instead of just 'auth' in order to prevent confusion that the
specified 'auth' module is in fact my own. I don't really want to go
through the process of renaming the module just because of this issue,
as it is the most appropriate name that I can think of. Any solutions,
anyone?

On 31 mrt, 13:57, sanderkrause  wrote:
> My INSTALLED_APPS looks like this currently.
>
> Note that I did not have this same problem before, when I was using
> Django 1.2. I recently upgraded to Django 1.3. Could this be part of
> the problem?
>
> The only other difference between now and then is that I used to have
> the entries for contrib.auth and such in the INSTALLED_APPS, but
> commented out. I don't see how this could affect my current situation
> though, so my guess is, something changed in Django 1.3. Can anyone
> confirm or deny this? I didn't see anything different in the
> documentation.
>
> INSTALLED_APPS = (
>     'django.contrib.sessions',
>     'form_utils',
>     'org',
>     'auth',
>     'entities',
> )
>
> On 31 mrt, 13:07, Daniel Roseman  wrote:
>
> > On Thursday, March 31, 2011 10:10:27 AM UTC+1, sanderkrause wrote:
>
> > > Because I'm using my own authentication and authorization system, I
> > > would like to completely disable these standard apps from Django.
>
> > > I've tried removing the relevant lines from MIDDLEWARE_CLASSES and
> > > INSTALLED_APPS, but when I use the syncdb command, the default tables
> > > that come with the default authentication system are still being
> > > created. Is there a way to prevent this from happening?
>
> > > Is there maybe another setting that I'm overlooking? Other possible
> > > variables that could cause these standard apps to be enabled despite
> > > my efforts?
>
> > > I also don't use the built-in admin system, so I don't think that
> > > could be a problem.
>
> > > Any hints?
>
> > The only reason syncdb would create the user tables is if contrib.auth is in
> > INSTALLED_APPS. Can you post that?
> > --
> > DR.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: WxPython and django

2011-03-31 Thread Calvin Spealman
Aref,

The question I would have is where your database sits. Is it supposed
to sit on a central server? In a website, your database only needs to
be accessed by machine rendering the pages. If you want the same
database talking to desktop applications, you need to let those apps
talk to the database or run the database on individual users'
machines. This is the part that concerns me, especially giving those
users access to a central DB.

On Thu, Mar 31, 2011 at 7:05 AM, Aref Nammari  wrote:
> Thanks for the reply Calvin. I realize what django is about and what it is
> meant for and I do understand what WxPython is capable of. I still think
> that this does not prevent using wxpython as a frontend for django
> app--instead of (or in conjunction with) HTML to render the page Iam
> thinking that I should be able to use wxpython--pass the data to wxpython
> module to display and take data from a form rendered with wxpython and send
> to django. This must doable I think.
>
> On Wed, Mar 30, 2011 at 8:24 PM, Calvin Spealman 
> wrote:
>>
>> They are completely unrelated. WX is a library for working with
>> desktop-based UI toolkits, and Django is a framework for producing and
>> delivering HTML/CSS/JS web content to a browser.
>>
>> On Wed, Mar 30, 2011 at 10:03 PM, Aref  wrote:
>> > Hello,
>> >
>> > I have created a small app with wxpython to manage and query databases
>> > and now I am learning django and was wondering if it is possible to
>> > incorporate some of the wxpython code in django. What I am trying to
>> > do is to create the same app as the one in wxpython but make it web-
>> > based rather than desktop. I know the django admin does that but I
>> > wanted to learn how to create web based apps and thought that would be
>> > a good exercise. Thanks for any pointers or ideas.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Django users" group.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/django-users?hl=en.
>> >
>> >
>>
>>
>>
>> --
>> Read my blog! I depend on your acceptance of my opinion! I am interesting!
>> http://techblog.ironfroggy.com/
>> Follow me if you're into that sort of thing:
>> http://www.twitter.com/ironfroggy
>
>



-- 
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://techblog.ironfroggy.com/
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



wsgi configuration

2011-03-31 Thread yongzhen zhang
Hi,
I am using apache + wsgi for my Django project. But now i am a bit
confused. The project is under /home/yongzhen/workspace/www . I put
the apache folder under www, and it is same level with the project
"iStore". i write django.wsgi inside apache like this:
import os
import sys
path='/home/yongzhen/workspace/www/iStore'
if path not in sys.path:
sys.path.append(path)

wsgi_dir=os.path.abspath(os.path.dirname(__file__))
project_dir=os.path.dirname(wsgi_dir)
sys.path.append(project_dir)
project_settings=os.path.join(project_dir,'settings')
os.environ['DJANGO_SETTINGS_MODULE']='www.iStore.settings'

import django.core.handlers.wsgi
application=django.core.handlers.wsgi.WSGIHandler()

But it does not work, the apache has the following error:
 mod_wsgi (pid=11619): Exception occurred processing WSGI script '/
home/yongzhen/workspace/www/apache/django.wsgi'.
 Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
wsgi.py", line 230, in __call__
 self.load_middleware()
   File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
base.py", line 33, in load_middleware
 for middleware_path in settings.MIDDLEWARE_CLASSES:
File "/usr/local/lib/python2.6/dist-packages/django/utils/
functional.py", line 276, in __getattr__
 self._setup()
   File "/usr/local/lib/python2.6/dist-packages/django/conf/
__init__.py", line 40, in _setup
self._wrapped = Settings(settings_module)
   File "/usr/local/lib/python2.6/dist-packages/django/conf/
__init__.py", line 75, in __init__
 raise ImportError("Could not import settings '%s' (Is it on
sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
e))
 [error] [client 66.249.66.53] ImportError: Could not import settings
'iStore.settings' (Is it on sys.path? Does it have syntax errors?): No
module named iStore.settings

It seems that something wrong with
"os.environ['DJANGO_SETTINGS_MODULE']='www.iStore.settings'", but it
also does not work when i change it to
os.environ['DJANGO_SETTINGS_MODULE']='iStore.settings'
Anyone knows what is the problem?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to disable default authentication/messaging system?

2011-03-31 Thread sanderkrause
My INSTALLED_APPS looks like this currently.

Note that I did not have this same problem before, when I was using
Django 1.2. I recently upgraded to Django 1.3. Could this be part of
the problem?

The only other difference between now and then is that I used to have
the entries for contrib.auth and such in the INSTALLED_APPS, but
commented out. I don't see how this could affect my current situation
though, so my guess is, something changed in Django 1.3. Can anyone
confirm or deny this? I didn't see anything different in the
documentation.

INSTALLED_APPS = (
'django.contrib.sessions',
'form_utils',
'org',
'auth',
'entities',
)

On 31 mrt, 13:07, Daniel Roseman  wrote:
> On Thursday, March 31, 2011 10:10:27 AM UTC+1, sanderkrause wrote:
>
> > Because I'm using my own authentication and authorization system, I
> > would like to completely disable these standard apps from Django.
>
> > I've tried removing the relevant lines from MIDDLEWARE_CLASSES and
> > INSTALLED_APPS, but when I use the syncdb command, the default tables
> > that come with the default authentication system are still being
> > created. Is there a way to prevent this from happening?
>
> > Is there maybe another setting that I'm overlooking? Other possible
> > variables that could cause these standard apps to be enabled despite
> > my efforts?
>
> > I also don't use the built-in admin system, so I don't think that
> > could be a problem.
>
> > Any hints?
>
> The only reason syncdb would create the user tables is if contrib.auth is in
> INSTALLED_APPS. Can you post that?
> --
> DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Newbie question - modelform / dropdown list

2011-03-31 Thread Daniel Roseman
On Thursday, March 31, 2011 12:43:32 PM UTC+1, rune wrote:
>
> Hi all, 
>
> I just started with Django, done the tutorial, now I'd like to create 
> a page were users can put 
> requests in a queue. Lets say the fields to display are user, date, 
> filepath, date to load. 
> I can create this with a modelform, but I'd like the user field to be 
> a drop down list with values, 
> read from the data base. How would I do this? 
>
> regards, 
>
> Rune


If the user field on your Queue model is a ForeignKey to the User model, 
which it should be, this will happen automatically when you create the 
modelform.
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Newbie question - modelform / dropdown list

2011-03-31 Thread Kenneth Gonsalves
On Thu, 2011-03-31 at 04:43 -0700, rune wrote:
> I just started with Django, done the tutorial, now I'd like to create
> a page were users can put
> requests in a queue. Lets say the fields to display are user, date,
> filepath, date to load.
> I can create this with a modelform, but I'd like the user field to be
> a drop down list with values,
> read from the data base. How would I do this? 

http://docs.djangoproject.com/en/1.3/topics/forms/modelforms/#using-a-custom-queryset
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Newbie question - modelform / dropdown list

2011-03-31 Thread rune
Hi all,

I just started with Django, done the tutorial, now I'd like to create
a page were users can put
requests in a queue. Lets say the fields to display are user, date,
filepath, date to load.
I can create this with a modelform, but I'd like the user field to be
a drop down list with values,
read from the data base. How would I do this?

regards,

Rune

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



make_messages verbosity

2011-03-31 Thread tavis
Just a small thing, I've noticed the default verbosity in the
make_messages function is the string '1'. The function never converts
this to an int, so if the function is called elsewhere without
specifying a verbosity level then when it checks to see if verbosity
is > 1 it always returns true.

Where should I report this?

Cheers,
Tavis

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Issues with post_save signals on test execution?

2011-03-31 Thread rikuthero...@gmail.com
Hi,

After migrate an application from Django 1.1 to Django 1.3 I noticed that
some unittest was failing. Debugging I get to the point that the post_save
functions didn't execute on test running. If I see the receivers on the test
execution:

ipdb> from django.db.models import signals
ipdb> signals.post_save.receivers
[]

But, seeing it on a ./manage.py shell:

In [4]: signals.post_save.receivers
Out[4]:
[((148050580, 135782264),
  ),
 ((148158980, 148372636),
  ),
 (((14908, 149046916), 148893804),
  BoundMethodWeakref( ._rename_resize_image )),
 (((150046508, 147356780), 150265060),
  BoundMethodWeakref( ._save )),
 (((150338604, 149046916), 150285820),


And a lot more... I check that the post_save signal is registering properly
on the test execution, but when you access to it, is empty.

Any ideas?

Thanks in advance

-- 
Pablo Recio Quijano

Desarrollador Django
Yaco Sistemas - http://www.yaco.es/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Please tell how to implement a new project?

2011-03-31 Thread Daniel Roseman
On Thursday, March 31, 2011 11:20:31 AM UTC+1, GOUTAM KUMAR RANA wrote:
>
> Please tell how to implement a new project? 
>
> I m new to Django projects . if possible give me a graphical idea of 
> using Django from the base to the output. 
>
> My target is to make an inventory for a particular shop. 
>
> When the user enters the admin page for the first time it should be 
> asked to enter the credentials of the super user's user name passwd , 
> store details, address, etc 
>
> And later the one should be having facility for user creation with 
> various permissions for transacting in the retail shop with their own 
> assigned id. the stock to maintained automatically. 
>
> the admin superuser login should be able to add catagory items vendors 
> price etc with other users who are given the permissions for such 
> with the facility  fo report and bill ... 
>
> - 
> Please help..


http://docs.djangoproject.com/en/1.3/intro/tutorial01/
--
DR. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Please tell how to implement a new project?

2011-03-31 Thread Kenneth Gonsalves
On Thu, 2011-03-31 at 03:20 -0700, GOUTAM KUMAR RANA wrote:
> I m new to Django projects . if possible give me a graphical idea of
> using Django from the base to the output. 

please do the 4 part tutorial first. It will give you all the knowledge
you need to do this.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Trouble raising forms.ValidationError in save() override in admin.py

2011-03-31 Thread Daniel Roseman
On Thursday, March 31, 2011 11:09:17 AM UTC+1, Lloyd Dube wrote:
>
> Hi Shawn,
>
> Thanks for the feedback. I read the docs and defined a clean_audio_file 
> method in my ModelAdmin class.


That's not what the docs say. They say you should create it on the Form. And 
where did you get the idea that the clean method takes any of those 
parameters?
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to disable default authentication/messaging system?

2011-03-31 Thread Daniel Roseman
On Thursday, March 31, 2011 10:10:27 AM UTC+1, sanderkrause wrote:
>
> Because I'm using my own authentication and authorization system, I 
> would like to completely disable these standard apps from Django. 
>
> I've tried removing the relevant lines from MIDDLEWARE_CLASSES and 
> INSTALLED_APPS, but when I use the syncdb command, the default tables 
> that come with the default authentication system are still being 
> created. Is there a way to prevent this from happening? 
>
> Is there maybe another setting that I'm overlooking? Other possible 
> variables that could cause these standard apps to be enabled despite 
> my efforts? 
>
> I also don't use the built-in admin system, so I don't think that 
> could be a problem. 
>
> Any hints?


The only reason syncdb would create the user tables is if contrib.auth is in 
INSTALLED_APPS. Can you post that?
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Please tell how to implement a new project?

2011-03-31 Thread GOUTAM KUMAR RANA
Please tell how to implement a new project?

I m new to Django projects . if possible give me a graphical idea of
using Django from the base to the output.

My target is to make an inventory for a particular shop.

When the user enters the admin page for the first time it should be
asked to enter the credentials of the super user's user name passwd ,
store details, address, etc

And later the one should be having facility for user creation with
various permissions for transacting in the retail shop with their own
assigned id. the stock to maintained automatically.

the admin superuser login should be able to add catagory items vendors
price etc with other users who are given the permissions for such
with the facility  fo report and bill ...

-
Please help..

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



datatrans

2011-03-31 Thread ug Charlie
How to use datatrans?

Is there anyone can help me?

I want to translate data from my db. lol

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to disable default authentication/messaging system?

2011-03-31 Thread sanderkrause
Because I'm using my own authentication and authorization system, I
would like to completely disable these standard apps from Django.

I've tried removing the relevant lines from MIDDLEWARE_CLASSES and
INSTALLED_APPS, but when I use the syncdb command, the default tables
that come with the default authentication system are still being
created. Is there a way to prevent this from happening?

Is there maybe another setting that I'm overlooking? Other possible
variables that could cause these standard apps to be enabled despite
my efforts?

I also don't use the built-in admin system, so I don't think that
could be a problem.

Any hints?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: WxPython and django

2011-03-31 Thread Aref
Thanks Mike. Yes I am following the philosophy of separating things.
The "GUI" is separate and resides in the templates and it simply used
for data display and data entry. I keep everything modular and try not
to mix functions and modules. I'll follow your ideas and see how
things work. Thanks for taking the time to respond.

On Mar 30, 9:11 pm, Mike Ramirez  wrote:
> On Wednesday, March 30, 2011 07:24:24 pm Calvin Spealman wrote:
>
>
>
> > They are completely unrelated. WX is a library for working with
> > desktop-based UI toolkits, and Django is a framework for producing and
> > delivering HTML/CSS/JS web content to a browser.
>
> > On Wed, Mar 30, 2011 at 10:03 PM, Aref  wrote:
> > > Hello,
>
> > > I have created a small app with wxpython to manage and query databases
> > > and now I am learning django and was wondering if it is possible to
> > > incorporate some of the wxpython code in django. What I am trying to
> > > do is to create the same app as the one in wxpython but make it web-
> > > based rather than desktop. I know the django admin does that but I
> > > wanted to learn how to create web based apps and thought that would be
> > > a good exercise. Thanks for any pointers or ideas.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Django users" group. To post to this group, send email to
> > > django-users@googlegroups.com. To unsubscribe from this group, send
> > > email to django-users+unsubscr...@googlegroups.com. For more options,
> > > visit this group athttp://groups.google.com/group/django-users?hl=en.
>
> This all depends on how you wrote the code.  Did you modularize the core
> functionality so it doesn't depend on wx?
>
> A good design practice is to seperate the core functionality from the GUI
> code.  This allows you to attach different frontends to your programs with
> relative ease.
>
> for example I have a system information tool.  The actual functionality to
> mine the system for the data it uses, is stand alone. It can run fine with a
> gui, cli or put a web app in front of it. Think of it as a library to mine the
> system.  You can do this with pretty much any kind of app. just have the app
> return data structures that are pure python code, like a dict or a class
> object.
>
> i.e. :
> proc_list = { procid: procdetails, }
>
> each element has it's procid as the key, the details of the proc are in
> procdetails which could be a list or a class containing the data.
>
> Then you could use wx to implement the display functionality of proc_list
> inyour GUI.  Django would be able to call the same code to display a proc
> list. or it can write to stdout to display the info.  
>
> But as said above, you can not reuse any wx widgets or most of it (probably, I
> haven't looked at wx in a long time).  With pyqt, qtcore. qnetwork, qtsql
> stuff could be used without pain with django. qtgui would not be feasible.
>
> Mike
>
> --
> Do more than anyone expects, and pretty soon everyone will expect more.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: WxPython and django

2011-03-31 Thread Aref
Thanks Mike. Yes I am following the philosophy of separating things.
The "GUI" is separate and resides in the templates and it simply used
for data display and data entry. I keep everything modular and try not
to mix functions and modules. I'll follow your ideas and see how
things work. Thanks for taking the time to respond.

On Mar 30, 9:11 pm, Mike Ramirez  wrote:
> On Wednesday, March 30, 2011 07:24:24 pm Calvin Spealman wrote:
>
>
>
> > They are completely unrelated. WX is a library for working with
> > desktop-based UI toolkits, and Django is a framework for producing and
> > delivering HTML/CSS/JS web content to a browser.
>
> > On Wed, Mar 30, 2011 at 10:03 PM, Aref  wrote:
> > > Hello,
>
> > > I have created a small app with wxpython to manage and query databases
> > > and now I am learning django and was wondering if it is possible to
> > > incorporate some of the wxpython code in django. What I am trying to
> > > do is to create the same app as the one in wxpython but make it web-
> > > based rather than desktop. I know the django admin does that but I
> > > wanted to learn how to create web based apps and thought that would be
> > > a good exercise. Thanks for any pointers or ideas.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Django users" group. To post to this group, send email to
> > > django-users@googlegroups.com. To unsubscribe from this group, send
> > > email to django-users+unsubscr...@googlegroups.com. For more options,
> > > visit this group athttp://groups.google.com/group/django-users?hl=en.
>
> This all depends on how you wrote the code.  Did you modularize the core
> functionality so it doesn't depend on wx?
>
> A good design practice is to seperate the core functionality from the GUI
> code.  This allows you to attach different frontends to your programs with
> relative ease.
>
> for example I have a system information tool.  The actual functionality to
> mine the system for the data it uses, is stand alone. It can run fine with a
> gui, cli or put a web app in front of it. Think of it as a library to mine the
> system.  You can do this with pretty much any kind of app. just have the app
> return data structures that are pure python code, like a dict or a class
> object.
>
> i.e. :
> proc_list = { procid: procdetails, }
>
> each element has it's procid as the key, the details of the proc are in
> procdetails which could be a list or a class containing the data.
>
> Then you could use wx to implement the display functionality of proc_list
> inyour GUI.  Django would be able to call the same code to display a proc
> list. or it can write to stdout to display the info.  
>
> But as said above, you can not reuse any wx widgets or most of it (probably, I
> haven't looked at wx in a long time).  With pyqt, qtcore. qnetwork, qtsql
> stuff could be used without pain with django. qtgui would not be feasible.
>
> Mike
>
> --
> Do more than anyone expects, and pretty soon everyone will expect more.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: WxPython and django

2011-03-31 Thread Kenneth Gonsalves
On Thu, 2011-03-31 at 03:30 -0700, Aref wrote:
> That's what I am looking for. Using wxpython to render some pages
> (templates) especially formatting data from the database. Is there
> some code snippets I can look at or maybe a tutorial to help me figure
> out how to do this? 

use standard django views - but send the result to a wxPython file
instead of an html file.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: WxPython and django

2011-03-31 Thread Aref
That's what I am looking for. Using wxpython to render some pages
(templates) especially formatting data from the database. Is there
some code snippets I can look at or maybe a tutorial to help me figure
out how to do this?
thanks

On Mar 30, 11:28 pm, Kenneth Gonsalves  wrote:
> On Wed, 2011-03-30 at 22:24 -0400, Calvin Spealman wrote:
> > They are completely unrelated. WX is a library for working with
> > desktop-based UI toolkits, and Django is a framework for producing and
> > delivering HTML/CSS/JS web content to a browser.
>
> not really so - I remember writing apps in wxPython, and basically I was
> writing something like views and templates. The the database api can be
> taken from django - the only difference is rendering in wsPython
> 'templates'.
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RE: staticfile app question

2011-03-31 Thread Chris Matthews
Hi,
I liked this explanation/convention 
http://forum.webfaction.com/viewtopic.php?id=4345 (I opted for this one).

If you want more consider django-css 
https://github.com/dziegler/django-css#readme (I have not tried this).

Regards
Chris


-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of typeshige
Sent: 31 March 2011 01:07
To: Django users
Subject: staticfile app question

Like many people, I'm switching over to use a static directory to
serve site media. Overall, it works extremely well, but I have a
question about one aspect of it.

I have a CSS file that includes urls. I was wondering about the
possibility of the staticfile app inserting the proper STATIC_URL as
it's being collected.

For example, things like:

#container-head {
background: transparent url('/static/img/bg/cap/head-inner-
bg.gif') 50% 0 no-repeat;
}

Would it be a bad idea to write like this:

#container-head {
background: transparent url('{{ STATIC_URL }}img/bg/cap/head-inner-
bg.gif') 50% 0 no-repeat;
}

the collectstatic command could insert the right url as it is being
copied?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Trouble raising forms.ValidationError in save() override in admin.py

2011-03-31 Thread Sithembewena Lloyd Dube
Hi Shawn,

Thanks for the feedback. I read the docs and defined a clean_audio_file
method in my ModelAdmin class. I dropped the Podcast table, made the field
not mandatory in the model and did a syncdb (to test my clean method).

Still a podcast can be saved without the audio_file: the code in the clean
method does not appear to run. Please see the code below:

class PodcastAdmin(admin.ModelAdmin):
 list_display = ('title', 'audio_file', 'active', 'user')

 def clean_audio_file(self, request, obj, form, change):
  data = self.cleaned_data['audio_file']
  if not data or len(data) < 1 or data == "":
   raise forms.ValidationError("Provide a file!")
  return data

admin.site.register(Podcast, PodcastAdmin)

Am at a loss.

On Wed, Mar 30, 2011 at 4:37 PM, Shawn Milochik  wrote:

> No, the forms.ValidationError has to be raised in one of the clean()
> methonds of your model. Otherwise it will result in a stack trace.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Regards,
Sithembewena Lloyd Dube

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to store multiple instances of a single object in the database

2011-03-31 Thread Ryan Osborn
No problem, glad to have helped :)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Invalid values in a form cause validation to fail

2011-03-31 Thread ALJ
Hi Karen,

Thanks. It looks like I need to upgrade. I was putting it off.

Neil

On Mar 31, 2:35 am, Karen Tracey  wrote:
> On Wed, Mar 30, 2011 at 6:34 AM, ALJ  wrote:
> > Hi Karen,
>
> > Here is an example that I use to replicate the error:
>
> > view >>
> > [snip]
>
> > form >
> > class RatingsListFilterForm(forms.Form):
> >    organisation_name = forms.CharField(required=False,
> > widget=forms.TextInput(attrs={'class':'textbox'}))
> >    corporation = forms.ModelChoiceField(required=False,
> > queryset=Corporation.objects.all(),
> > widget=forms.Select(attrs={'class':'selector'}))
> >    
>
> > Traceback>>
> > [snip]
> > I'm using Django 1.1 if that makes any difference
>
> This was a bug in Django, the code you post works on 1.3 and 1.2.5. I
> believe the issue was corrected with the fix for ticket #13149.
>
> Karen
> --http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



'NoneType' object has no attribute 'set_cookie'

2011-03-31 Thread Santiago Caracol
Hello,

I didn't use a certain Django project for a few weeks. Now I wanted to
continue developing the project and, as it usually happens with
software that has been left alone for a while, it didn't work
anymore. I am not aware of having changed anything. The system
administrator may, of course, have made some changes to the
system. When I try to add a new object, regardless of which type, in
the admin interface, I get the error messages given below. (I had to
shorten the error message for Google Groups to allow me to post it.)

Any ideas what I could do?

Santiago

##


AttributeError at /admin/monitoring/message/add/

'NoneType' object has no attribute 'set_cookie'

Request Method: GET
Request URL:http://localhost:8000/admin/monitoring/message/add/
Django Version: 1.3
Exception Type: AttributeError
Exception Value:

'NoneType' object has no attribute 'set_cookie'

Exception Location: /usr/local/lib/python2.6/site-packages/django/
middleware/csrf.py in process_response, line 239
Python Executable:  /usr/bin/python
Python Version: 2.6.2
Python Path:[...]

Server time:Thu, 31 Mar 2011 10:10:30 +0200
Traceback Switch to copy-and-paste view

[...]

  response

  None

  result

  None

  kwargs

  {}

  view_func

  

* /usr/local/lib/python2.6/site-packages/django/middleware/csrf.py
in process_response
   232.

if request.META.get("CSRF_COOKIE") is None:

   233.

return response

   234.

   235.

if not request.META.get("CSRF_COOKIE_USED",
False):

   236.

return response

   237.

   238.

# Set the CSRF cookie even if it's already set, so
we renew the expiry timer.

   239.

response.set_cookie(settings.CSRF_COOKIE_NAME,

...
   240.

request.META["CSRF_COOKIE"], max_age = 60
* 60 * 24 * 7 * 52,

   241.

domain=settings.CSRF_COOKIE_DOMAIN)

   242.

# Content varies with the CSRF cookie, so set the
Vary header.

   243.

patch_vary_headers(response, ('Cookie',))

   244.

response.csrf_processing_done = True

   245.

return response

  ▶ Local vars

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Hi multilingual charfields?

2011-03-31 Thread Xavier Ordoquy
Hi,

Le 31 mars 2011 à 09:34, Mika Sjöman a écrit :

> Hi
> 
> The content of my models have fields that need to be translated in the django 
> admin in several languages.
> 
> I found it to be a major hassle to get it working. Since django is having 
> internationalization built in, why does it not also allow you to easily mark 
> model fields for translation?

Django provides tools to get static content translated.
You are trying to do so on dynamic content which is really different.
You might want to look at http://djangopackages.com/grids/g/model-translation/ 
to get what you're looking for.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Hi multilingual charfields?

2011-03-31 Thread bruno desthuilliers
On 31 mar, 09:34, Mika Sjöman  wrote:
> Hi
>
> The content of my models have fields that need to be translated in the
> django admin in several languages.

How many ? Three or two dozen ?

> I found it to be a major hassle to get it working.

If you have no more than 2 or 3 languages to support, django-
transmetta has been an easy-working solution for us so far. Now I
don't think it would scale that well with too many languages -
depending on your model, it might add way too many fields to the
underlying table. In this case you may prefer another solution using
distinct rows for the translated versions (there are quite few django
apps doing this one way or another).

> Since django is having
> internationalization built in, why does it not also allow you to easily mark
> model fields for translation?

Because i18n is definitly not a simple problem, so there's no good one-
size-fits-all solution. The "right" strategy depends too much on your
specific application and needs.

B.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Hi multilingual charfields?

2011-03-31 Thread Mika Sjöman
Hi

The content of my models have fields that need to be translated in the
django admin in several languages.

I found it to be a major hassle to get it working. Since django is having
internationalization built in, why does it not also allow you to easily mark
model fields for translation?

I think it should be built in to core since so many of us use multiple
languages in our webapps, so using it would be something like this:

1. import the multilang in models.py
2. flag specific fields for content translation
3. set the LANGUAGES in settings.py

What do you guys think?

// mika

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RE: multiline TextField

2011-03-31 Thread Chris Matthews
By using the Textarea widget:

class SomeForm(forms.Form):
description = forms.CharField(widget=forms.Textarea())

Regards
Chris


-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of electrocoder
Sent: 31 March 2011 00:18
To: Django users
Subject: multiline TextField

Hi. I write blog application. I want multiline TextField.
Sample : paragraph or tab or return
thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



getting _collect_sub_objects() error during delete if a foriegn key's foreign key is null

2011-03-31 Thread dan levine
Trying to delete objects from the django admin or app code, I'm
getting an error:

File "/home/styleseat/ssenv/lib/python2.6/site-packages/django/db/
models/base.py", line 595, in _collect_sub_objects
  sub_obj._collect_sub_objects(seen_objs, self, related.field.null)
AttributeError: ‘NoneType’ object has no attribute
‘_collect_sub_objects’

I'm using django 1.2.1 final

I think its easiest to decribe the models rather than post:

I'm trying to delete a Pro object.  Related models: we have
GalleryImage objects, GalleryImage extends Image, GalleryImage has a
FKs (null=True, blank=True) to Pro and to a Location object

If the Pro has any GallleryImage objects with a null Location the
error is thrown.  If I assign a Location object to the GalleryImage
then the Pro will delete, along with the GalleryImage objects and the
Location object.

Any thoughts?  I can put together a simple test case and post a bug
and/or work on a patch, but maybe its already been addressed in 1.3

Stack trace:

File "/home/styleseat/ssenv/lib/python2.6/site-packages/django/contrib/
admin/options.py", line 1167, in delete_view
  (deleted_objects, perms_needed) = get_deleted_objects((obj,), opts,
request.user, self.admin_site)
File "/home/styleseat/ssenv/lib/python2.6/site-packages/django/contrib/
admin/util.py", line 111, in get_deleted_objects
  obj._collect_sub_objects(collector)
File "/home/styleseat/ssenv/lib/python2.6/site-packages/django/db/
models/base.py", line 613, in _collect_sub_objects
  sub_obj._collect_sub_objects(seen_objs, self, related.field.null)
File "/home/styleseat/ssenv/lib/python2.6/site-packages/django/db/
models/base.py", line 595, in _collect_sub_objects
  sub_obj._collect_sub_objects(seen_objs, self, related.field.null)
AttributeError: ‘NoneType’ object has no attribute
‘_collect_sub_objects’


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RE: model manager and request

2011-03-31 Thread Chris Matthews
Hi,

1) My need for getting the current user is that I want the following columns on 
all tables: created, created_by, updated and updated_by.

So I defined this abstract class which I inherit from on all models:

class AbstractCommonAll(models.Model):
r''' All our tables will be defined with this class. We always want to know 
who
created it and when it was done. The same goes for who updated it and when 
it was done.

We could either have:
1 A char field for the user.
2 A foreign key to the user table.

If we take option 2 then we must define users for our batch jobs as well 
and all the queries
and updates will have to link to the user table. So let us just implement 
option 1 for now.
We can always change this at a later stage.
'''
created= models.DateTimeField(editable=False, help_text='When this row 
was created')
created_by = models.CharField(max_length=20, editable=False, help_text='Who 
created this row')
updated= models.DateTimeField(editable=False, help_text='When this row 
was updated')
updated_by = models.CharField(max_length=20, editable=False, help_text='Who 
updated this row')

class Meta:
abstract = True

def save(self):
if not self.id:
self.created = datetime.today()
self.created_by = 'user' # we should get this from 
request.User.username 
self.updated = datetime.today()
self.updated_by = 'user' # we should get this from request.User.username

super(AbstractCommonAll, self).save()

I am still going to implement getting the request.User.username as per ProJango 
by Marty Alchin Chapter 11 (page 253 onwards). I could do it in a view but then 
I still need it in the saves via admin. I should probably allocate a user for 
the batch programs and let them sign on so that they may have authenticated 
access and I suspect that I should make this batch user name available to 
AbstractCommonAll.save() because there will not be a request structure 
available.


2) For Audit/History records see the book ProJango by Marty Alchin Chapter 11 
(page 263 onwards) and 
http://qr7.com/2010/10/django-simple-history-ftw/ by Corey Bertram.
It handles the Historical records.

There is a possible error (depending upon your naming convention) when the 
indexes for the history tables are created:
sql_indexes_for_field() in 
/Python26/lib/site-packages/django/db/backends/creation.py creates the database 
index with name being model name + column name. This causes a problem for this 
implementation of history. 
The error is: Failed to install index for myapp.historical_Line model: relation 
" myapp_historical_line_type_id" already exists

It happens when the one modelname + foreignkey column name + '_id' is the same 
as the referenced modelname + '_id', as in the following example:

class Line_Type(models.Model):
name = models.CharField(max_length=50, unique=True)
description = models.CharField(max_length=100)

class Line(models.Model):
type= models.ForeignKey(Line_Type)


So the indexes created would be:
CREATE INDEX " myapp_historical_line*_type_id" ON " myapp_historical_line" 
("type_id");
CREATE INDEX " myapp_historical_line_type*_id" ON " 
myapp_historical_line_type" ("id");
 * is on the model/column name border.

To bypass this error I renamed my linked field (I thought that it would be more 
difficult to have sql_indexes_for_field changed [put a specified literal e.g. 
'_x_' between model & column names]) as follows:

class Line(models.Model):
line_type= models.ForeignKey(Line_Type)

(PS: I prefixed 'zz' to the history table names so that pgAdmin lists them at 
the end of, or after, the 'real' tables).

Regards
Chris


-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Tony
Sent: 30 March 2011 22:27
To: Django users
Subject: Re: model manager and request

yeah, shawn said the exact dilemma I am having.  I am working with a
plugged in app and dont want to change its code and mess with its
views and create a new fork, it just seems like small thing to make a
change for (and I would probably mess something else up).

On Mar 30, 11:58 am, Shawn Milochik  wrote:
> Jacob,
>
> This sort of thing comes up so frequently on this list that we've all
> seen those answers dozens of times, although not usually in so concise
> a manner.
>
> My question, to which there seems to be no answer, is what a good
> approach to do something that I know (from spending a long time on
> this list) is also in high demand: Storing audit information.
>
> Simple requirement:
>     Store datetime.now(), request.user, and changes to a model
> automatically on post_save.
>
> Problem:
>     The "correct" solutions do not work. If you're using any pluggable
> apps at all you have to fork them or not log them. Refactoring is not
> an option.
>
> I 

django plugin/extension for geany

2011-03-31 Thread Kenneth Gonsalves
hi,

a web search did not help, so does anyone know if there is a django
plugin/extension for geany?
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: I want Develop django poll app tuturial

2011-03-31 Thread cha
ok in beginning 
how i can get percentage for each vote ?

this result code 

def results(request, poll_id):
p = get_object_or_404(Poll, pk=poll_id)
return render_to_response('polls/results.html', {'poll': p})


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



  1   2   >