Thursday, March 31, 2011

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

Hi Nge,

Use pgAdmin that was installed with your postgresql. Open a connection to your database->Schema->Public->Tables. Right-click on your table and click on View data and then take one of the view options.

You can also open a SQL window and run the SQL select yourself. See pgAdmin's help.

Regards
Chris

-----Original Message-----
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Nge Nge
Sent: 01 April 2011 04:30
To: Django users
Subject: How to check the text field values are in my database or not ?

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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: DjangoCon US 2011

The event will definitely take place in Portland, Oregon in September.

On Apr 1, 2011 12:15 AM, "Vinicius Mendes" <vbmendes@gmail.com> 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 <holdenweb@gmail.com> 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" <shawn@milochik.com> 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+unsubscribe@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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: DjangoCon US 2011

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 <holdenweb@gmail.com> 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" <shawn@milochik.com> 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+unsubscribe@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+unsubscribe@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+unsubscribe@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

On Thu, Mar 31, 2011 at 7:18 PM, Russell Keith-Magee
<russell@keith-magee.com> 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+unsubscribe@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

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 <kmtra...@gmail.com> wrote:
> On Thu, Mar 31, 2011 at 3:35 PM, Nan <ringe...@gmail.com> 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+unsubscribe@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 ?

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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: WxPython and django

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.
<vincent> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

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

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 <mr.sam...@gmail.com> 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 <hversem...@stchas.edu> 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 <hversem...@stchas.edu> 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 <mr.sam...@gmail.com> 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 <hversem...@stchas.edu> 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+unsubscribe@googlegroups.com.
> >> > > For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.-Hidequoted 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

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

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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

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

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 <hversemann@stchas.edu> 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 <hversem...@stchas.edu> 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 <mr.sam...@gmail.com> 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 <hversem...@stchas.edu> 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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: WxPython and django

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 <ironfroggy@gmail.com> 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 <arefnammari@gmail.com> 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 <ironfroggy@gmail.com> 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 <arefnammari@gmail.com> 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 <ironfroggy@gmail.com>
>>> 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 <arefnammari@gmail.com> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

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

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 <hversem...@stchas.edu> 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 <mr.sam...@gmail.com> 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 <hversem...@stchas.edu> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

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

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 <mr.sam...@gmail.com> 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 <hversem...@stchas.edu> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

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

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 <hversemann@stchas.edu> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Need help: request.POST.copy() ?

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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: WxPython and django

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 <arefnammari@gmail.com> 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 <ironfroggy@gmail.com> 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 <arefnammari@gmail.com> 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 <ironfroggy@gmail.com>
>>> 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 <arefnammari@gmail.com> 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+unsubscribe@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+unsubscribe@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

On Fri, Apr 1, 2011 at 8:09 AM, Adam Nelson <adam@varud.com> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Serve a tracking pixel via Django

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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: DjangoCon US 2011

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" <shawn@milochik.com> 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+unsubscribe@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+unsubscribe@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

On Thu, Mar 31, 2011 at 3:35 PM, Nan <ringemup@gmail.com> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: DjangoCon US 2011

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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: south for django

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. <jay.developer2000@gmail.com> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: about url tag

ok, thanks everyone

2011/3/31 Łukasz Rekucki <lrekucki@gmail.com>:
> On 31 March 2011 18:50, Lic. José M. Rodriguez Bacallao
> <jmrbcu@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
>
> 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 "<module_path>.<function_name>". 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: south for django


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. <jay.developer2000@gmail.com> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: DjangoCon US 2011

I was wondering about that too.... seeing as how I live in Portland.

On Thu, Mar 31, 2011 at 11:49 AM, Vinicius Mendes <vbmendes@gmail.com> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

south for django


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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: south for django


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 <shawn@milochik.com> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: south for django

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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: south for django


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 <shawn@milochik.com> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: idiotic foreignkey error

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 <nickt...@gmail.com> 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 <sh...@milochik.com> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: south for django

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+unsubscribe@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

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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

south for django

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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: idiotic foreignkey error

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 <sh...@milochik.com> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: idiotic foreignkey error

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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

idiotic foreignkey error

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:

<class 'Government.Elections_New.models.Campaign'> has more than 1
ForeignKey to <class 'Government.Elections_New.models.Race'>

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+unsubscribe@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

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 (<select>) I want to write "Other" as the last <option> to choose.

Regards,
Álex Gonzálkez

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

DjangoCon US 2011

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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Dynamically generating form fields

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.


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 <irfsan3@gmail.com> 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('<b>%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+unsubscribe@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+unsubscribe@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

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 <shawn@milochik.com> wrote:


On Mar 31, 2011 1:55 PM, "jay K." <jay.developer2000@gmail.com> 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 <shawn@milochik.com> wrote:
>>
>> On Thu, Mar 31, 2011 at 1:39 PM, jay K. <jay.developer2000@gmail.com> wrote:
>>
>> <snip>
>> >
>> >
>> > 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+unsubscribe@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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.