Re: view didn't return an HttpResponse object....plz help

2012-07-04 Thread manish girdhar
thanks for the help friend..after manipulate that thing i got an error of* *UnboundLocalError at /record_system/studentid/ local variable 'rollno' referenced before assignment ... On Thu, Jul 5, 2012 at 11:52 AM, dizzydoc wrote: > The only condition where this view wont return an HTTPResponse i

Re: map in django

2012-07-04 Thread yarko
On Wednesday, July 4, 2012 10:53:41 AM UTC-5, yarko wrote: > > You might try browsing these: > > http://pyvideo.org/search?models=videos.video&q=making+maps > > > Apologies - Swype caused more than one typo: > http://inzane.net > => http://inzain.net > The code from Zain

Re: view didn't return an HttpResponse object....plz help

2012-07-04 Thread dizzydoc
The only condition where this view wont return an HTTPResponse is when request.method == 'POST' is True and form.is_valid() is False. In this condition the outer if condtion would complete execution and exit out since inner if condition is False and wont enter inner if condition. I think you s

view didn't return an HttpResponse object....plz help

2012-07-04 Thread rick
i want to filter roll no from database,but when i enter the number ,browser gives *view didn't return an HttpResponse object* this is my view.. def studentid(request): if request.method == 'POST': form = Student_loginForm(request.POST) if form.is_valid(): cd =

Re: Article Viewer / Better way to do this? / Suggestions Please

2012-07-04 Thread Barry Morrison
I built the model as I imagined how it should be. Looks like I can rework it to not need the pages model. Thanks for that! The .url is also fantastic! Much appreciated! Thanks. On Wednesday, July 4, 2012 5:22:10 PM UTC-7, Nikolas Stevenson-Molnar wrote: > > Yes, pagination should get you wh

help

2012-07-04 Thread mwagdy
*welcome * * * * * * * *i'm beginner in Django developer and i want a help * * * * * *now i develop an event system * *i want when clicked any event name * * * *event detailed appear in another page * ** * in attachment a picture that will reveal my want* *and also there is

Re: cannot access admin

2012-07-04 Thread Nikolas Stevenson-Molnar
One thing you might consider is using a prefix for article URLs so that you can more easily differentiate them from other URLs. For example: r'^articles/(\S+)/(\S+)' . Then, rather than a URL like /source-code/c++, you'd have /articles/source-code/c++. _Nik On 7/4/2012 5:59 PM, Scott Somers wrot

Re: cannot access admin

2012-07-04 Thread Scott Somers
here we go I actually had a typo that slipped in, everything is working perfectly now thanks again to everyone. urlpatterns = patterns('', (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT }), ) urlpatterns += patterns('', url(r'^$', 'tacobakedotnet.

Re: cannot access admin

2012-07-04 Thread Scott Somers
Yes, and this is a little embarrassing I was missing a line from the debugging output. /home/tacobake/Source Code/Python (Komodo)/tacobakedotnet/../tacobakedotnet/dotnet_forms/views.py in home 1. article = Article.objects.get(menu__menu_title = menu, article_title__start

Re: Article Viewer / Better way to do this? / Suggestions Please

2012-07-04 Thread Nikolas Stevenson-Molnar
Yes, pagination should get you what you want here. Using Django's built-in pagination, you can drop your Page model completely (unless you have a compelling reason to persist the page structure rather than letting Django determine it for you on the fly). One additional note, your Page.thumbnail_ me

Article Viewer / Better way to do this? / Suggestions Please

2012-07-04 Thread Barry Morrison
I have a bunch of press articles, these articles are basically thumbnails that open up to the pages of the articles. Here's what I've got so far. https://gist.github.com/0951804f4592c970b18b My thoughts are to use something like Django's pagination [1] https://docs.djangoproject.com/en/1.4/topic

Re: Admin actions -- short_description as doc string?

2012-07-04 Thread Russell Keith-Magee
On Wed, Jul 4, 2012 at 8:21 PM, Roy Smith wrote: > I'm just staring to explore admin actions. I'm surprised to see that you > have to set the description by doing: > > my_action_function.short_description = "blah" > > wouldn't it be cleaner to just declare a doc string for the action function >

Re: cannot access admin

2012-07-04 Thread Nikolas Stevenson-Molnar
And actually, \S matches forward slashes, so even something like /one/two/foo/bar would match. _Nik On 7/4/2012 3:40 PM, Nikolas Stevenson-Molnar wrote: > Yes. \S+/\S+ will match /. Since /admin doesn't > contain a slash (other than the leading slash, which isn't considered), > it works fine. But

Re: cannot access admin

2012-07-04 Thread Nikolas Stevenson-Molnar
Yes. \S+/\S+ will match /. Since /admin doesn't contain a slash (other than the leading slash, which isn't considered), it works fine. But /admin/whatever will get directed to your tacobakedotnet.dotnet_forms.views.home view because it matches the URL pattern. An easy fix would be to make sure your

Re: cannot access admin

2012-07-04 Thread Tomas Neme
On Wed, Jul 4, 2012 at 7:33 PM, Tomas Neme wrote: > ah, got it... your > > url(r'^(\S+)/(\S+)', 'tacobakedotnet.dotnet_forms.views.home'), > > is too permisive ... maybe? -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_|

Re: cannot access admin

2012-07-04 Thread Tomas Neme
ah, got it... your url(r'^(\S+)/(\S+)', 'tacobakedotnet.dotnet_forms.views.home'), is too permisive On Wed, Jul 4, 2012 at 6:54 PM, Scott Somers wrote: > > /Local Python Source Code/tacobakedotnet > manage.py > settings.py > urls.py > /Local Python Source Code/tacobakedotnet/media > JavaScript

Re: cannot access admin

2012-07-04 Thread Scott Somers
/Local Python Source Code/tacobakedotnet manage.py settings.py urls.py /Local Python Source Code/tacobakedotnet/media JavaScript files /Local Python Source Code/tacobakedotnet/dotnet_forms models.py tests.py views.py /Local Python Source Code/tacobakedotnet/dotnet_forms/static CSS files What it is

Re: migration via south for inheritance change -> please help

2012-07-04 Thread Tomas Neme
By the way, if you do that, and I'm not crazy, you won't need to do any migration with south, since the Foo and Bar tables would both have all of base's columns (because Base is abstract). If Base can't be abstract (if you want Base instances that are neither Foo nor Bar), then you'll have to do t

RE: migration via south for inheritance change -> please help

2012-07-04 Thread Demian Brecht
I'm not a South expert, but I'd assume you'd do this via south data migrations (http://south.readthedocs.org/en/latest/tutorial/part3.html#data-migrations) . You'd create: - One (auto) migration script to create the Base table and new columns in Foo and Bar - A data migration script to migrate the

Re: mysqldb help! Can't connect to MySQL server error...

2012-07-04 Thread Matthew Piatkowski
mdsmoke, do yourself a favor. You have exposed your password and the user name of your db; change your password. Also, best practices for using databases, is create an administrative login insead of using 'root'. Its much easier for a nasty malicious person or organisation to guess (root) tha

Re: migration via south for inheritance change -> please help

2012-07-04 Thread Tomas Neme
You'll have to migrate your data manually in your migration, yes. Besides that, if you don't want actual Base instances, then this is an abstract class, and you should do this: class Base(models.Model): eggs plants class Meta: abstract=True class Foo(Base): carpet

Re: migration via south for inheritance change -> please help

2012-07-04 Thread Lachlan Musicman
I'd like to know this too - but I think the real answer is "get better at python" - you are essentially (from what I can tell) in a django shell when south pops the "not blank, not null but no data" error - try pulling in some details from fixtures? cheers L. On Thu, Jul 5, 2012 at 2:30 AM, Danie

Re: custom500 page does not show up ?

2012-07-04 Thread Nikhil Verma
Hi Melvyn, The interesting thing is 404.html is working but not 500.html. In settings paths are dynamically set. Also i am receiving the error messages on my email as i am the admin. Let say there is some syntax error so in the email it will give me information about that but without displaying 5

Re: install a new model in my project

2012-07-04 Thread Tomas Neme
> (django_multiuploader), and i write in INSTALLED_APPS 'sorl.thumbnail', > 'multiuploader', then i execute manager.py runserver and return "Error: No > module named multiuploader" I dont understand how make a link for this > module. *How* did you install it? are you using pip and a virtua

Re: problem with django model method save()

2012-07-04 Thread Tomas Neme
I don't see why wouldn't your model's .save() work, maybe we'd need to see the model code, but I know you probably want to read this: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/ once you've implemented a ModelForm, you'd pretty much would just do form = RoomForm(request.POST)

problem with django model method save()

2012-07-04 Thread rafiee.nima
Hi Im some how new to django . I write a view to handle ajax request but I find out that save() method dose not save model instance in to the database here is my code def add_room(request): context={} status='' if request.is_ajax: if request.POST: hotel_instance=H

Problem to complète the xml template

2012-07-04 Thread nef
Hello, I want to cry a function allowing me to complete a template *. Xml. May I have a problem with the passage of the object render_to_response. In short here is my code. In fact, I do not know how to return an object that can permattre me to complete my template automatically. I am using djan

Re: cannot access admin

2012-07-04 Thread Melvyn Sopacua
On 4-7-2012 19:18, Scott Somers wrote: > My urls > > urlpatterns = patterns('', > (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': > settings.MEDIA_ROOT }), > ) > > urlpatterns += patterns('', > url(r'^$', 'tacobakedotnet.dotnet_forms.views.home'), > url(r'^(\S+)/(

Re: custom500 page does not show up ?

2012-07-04 Thread Melvyn Sopacua
On 4-7-2012 19:08, Nikhil Verma wrote: > Hi Melvyn > > > > [ ] Make sure your custom page is not sent with tools like netcat, > telnet or curl. > > i did not turn anything its a simple custom page. Sorry I worded that rather bad. Your goal is to connect to the page that triggers a 500 error wi

install a new model in my project

2012-07-04 Thread dhararon
Hi, my problem is that i when try to install a model, in this case is (django_multiuploader), and i write in INSTALLED_APPS 'sorl.thumbnail', 'multiuploader', then i execute manager.py runserver and return "Error: No module named multiuploader" I dont understand how make a link for thi

RE: cannot access admin

2012-07-04 Thread lacrymol...@gmail.com
Are you running admin.autodiscover? Does the admin homepage (/admin/) show your apps? -Mensaje original- De: Scott Somers Enviados: 04/07/2012 14:18:45 Asunto: cannot access admin So I don't normally spam forums/ mailing lists etc for help but I really screwed something up. Basicall

Re: Use regular expression to retrieve all image tags from a given content

2012-07-04 Thread Tim Chase
On 07/04/12 08:30, Melvyn Sopacua wrote: > On 4-7-2012 3:03, Tim Chase wrote: >> [snip Tim's obscene regex] > > Aside from the \b matching positive against ><, I'm not sure I follow...the \b just requires that a word-boundary occur there, preventing it from matching something like "imgood". It m

Re: Testing with LiveServerTestCase and Selenium

2012-07-04 Thread Paul Childs
I thought it might be a good idea to remove Django testing from the equation by opening up an IPython session and executing the following: from selenium import webdriver browser = webdriver.Firefox() browser.get("http://www.microsoft.com/";) browser.title '' # empty string The the same thing

cannot access admin

2012-07-04 Thread Scott Somers
So I don't normally spam forums/ mailing lists etc for help but I really screwed something up. Basically when I try and access my admin site, for example: DoesNotExist at /admin/auth/group/ Article matching query does not exist. DoesNotExist at /admin/dotnet_forms/article/ Article matching q

Re: custom500 page does not show up ?

2012-07-04 Thread Nikhil Verma
Hi Melvyn [ ] Make sure your custom page is not sent with tools like netcat, telnet or curl. i did not turn anything its a simple custom page. [ ] Make sure your custom page is not generating a 500 error by itself {% extends 'base.html' %} {% block title %} 500 - Server Error {% endblock %}

Re: how to save response 's render file to server or email using httpresponse

2012-07-04 Thread Nikolas Stevenson-Molnar
I stand corrected ;) _Nik On 7/4/2012 8:37 AM, Melvyn Sopacua wrote: > On 3-7-2012 20:32, Nikolas Stevenson-Molnar wrote: >> Oh, and HttpResponse is intended to send data back to a web browser. I >> can't think of any reason you would use an HttpResponse when sending an >> email. > To mail yourse

Forms for updating a compound model

2012-07-04 Thread yak-man
Have a look at this section and seder if it helps: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit h

Re: custom500 page does not show up ?

2012-07-04 Thread Melvyn Sopacua
On 4-7-2012 5:21, Nikhil Verma wrote: > HI All > > I have made a custom and a very simple 500.html page. However when i make > debug=False and some error come in website > still it show basic server error message. > > "A server error has occurred.Please contact the administrator" > > I want when

Re: Super slow authentication

2012-07-04 Thread Melvyn Sopacua
On 4-7-2012 1:57, Ali Mesdaq wrote: > Hey everyone, > > I got a situation where I have SUPER slow authentication like approx 5min > to authenticate with both LDAP and default authentication mechanisms. LDAP authentication for what exactly? Django doesn't come with an LDAP-based authentication sys

Re: map in django

2012-07-04 Thread yak-man
You might try browsing these: http://pyvideo.org/search?models=videos.video&q=making+maps http://inzane.net The code from Zain's US PyCon2012 tutorial on making interaxtive maps is also in his github repositories - you might find that interesting. Have lots of fun! -Yarko -- You received th

Re: Dumpdata and serialization issues

2012-07-04 Thread Melvyn Sopacua
On 4-7-2012 1:13, natasha.ba...@utoronto.ca wrote: > On Tuesday, July 3, 2012 5:55:32 PM UTC-4, ke1g wrote: >> >> In fact, I think dumpdata takes an app name, not a table or model name. No it doesn't. It can take a app.model name as well and is more commonly used, since the primary use case for du

Re: Controlling access

2012-07-04 Thread Melvyn Sopacua
On 3-7-2012 19:39, Larry Martell wrote: > I have a client that asked me to add some new functionality to their > app, and then they said 'This new functionality should be controlled > in Django admin so that only the admin user can see it.' Is there a > way to control this in Django admin? I know i

Re: how to save response 's render file to server or email using httpresponse

2012-07-04 Thread Melvyn Sopacua
On 3-7-2012 20:32, Nikolas Stevenson-Molnar wrote: > Oh, and HttpResponse is intended to send data back to a web browser. I > can't think of any reason you would use an HttpResponse when sending an > email. To mail yourself (parts of) the response object from middleware as part of auditing and/or

Help getting my first django site deployed! (heroku)

2012-07-04 Thread Matthew Meyer
Hello all! I am in the process of deploying my first django site: http://pure-mist-4298.herokuapp.com/ Currently, I have two major issues I am unsure how to resolve. 1. Something is messed up with my database settings. I followed this tutorial to get started: https://devcenter.heroku.com/arti

Re: Conditionals in Templates

2012-07-04 Thread Melvyn Sopacua
On 4-7-2012 0:49, Javier Guerra Giraldez wrote: > On Tue, Jul 3, 2012 at 3:39 PM, Bill Freeman wrote: >> The obvious ways are: >> >> 1. Provide a model method that returns a string representing the type >> of the instance, compare against that >> 2. Decorate the instance with an attribute giving t

Re: Raise 404

2012-07-04 Thread Melvyn Sopacua
On 3-7-2012 21:38, Smaran Harihar wrote: > Hey Djangoers, > > I am on my tutorial 3 and I was on this > topic > . > > And now if I try to access http://localhost:8000/polls/1/ it gives me the > same error page, which it gives fo

Re: Inheriting template with a form into an existing template

2012-07-04 Thread Melvyn Sopacua
On 3-7-2012 18:46, DF wrote: > I have a simple note taking part of my application I'm trying to converge > into one template. Currently, I have one template and view that renders and > posts the form and another that displays the results. I'd like to > amalgamate these into one where the form ex

Re: specify the foreign keys in a ManyToManyField created table?

2012-07-04 Thread eiriks
I've tried (among many things) to set the person in Dagensrepresentanter to primary_key=True. person = models.ForeignKey(Personer, primary_key=True, related_name='dagensrepresentanter_person') to force the relationship to include the "right" id. This seems to do just that. I'm unsure if th

Re: migration via south for inheritance change -> please help

2012-07-04 Thread Daniel Walz
...no one? regards, mcJack 2012/7/2 mcJack : > Hi all, > > I've got a problem migrating some changes in the model, so I tried to solve > it with south. > The situation: > I implemented two classes, which share some functionality. Now that I > improved a little with python, django and co. I wanted

Re: Forms for updating a compound model

2012-07-04 Thread Tomas Neme
I'm sorry to tell you that ModelForms don't seem to have this functionality, but I'm happy to tell you that ModelAdmins do. What it does, basically, is to return this: { 'label': label_for_field(field, self.opts.model, self.opts), 'widget': { 'is_hidden': False }, 'requ

Re: values() and order_by()

2012-07-04 Thread J. Javier Maestro
On Wed, Jul 4, 2012 at 1:59 PM, J. Javier Maestro wrote: > Hi there! > > Thanks a lot for the reply. However, I don't think your solution would > work in my case, nor it answers the question of whether it can be done > or why the order_by() adds stuff to the GROUP BY clause when used in > conjunct

Re: values() and order_by()

2012-07-04 Thread J. Javier Maestro
Hi there! Thanks a lot for the reply. However, I don't think your solution would work in my case, nor it answers the question of whether it can be done or why the order_by() adds stuff to the GROUP BY clause when used in conjunction with values(). Let's see: On Tue, Jul 3, 2012 at 11:08 PM, Bill

Django Book In Persian

2012-07-04 Thread Amin Oruji
Django Book site in Persian langage launched. www.djangobook.ir -- 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+unsu

Re: Deployment: Apache2, wsgi (Debian squeeze)

2012-07-04 Thread Melvyn Sopacua
On 3-7-2012 5:03, Matt Smith wrote: > Up until now I've been serving non-dynamic content the usual way. I > apt-got installed apache2, worked out /var/www was the root, followed > the index.html convention and that worked fine. Now I feel I'm stuck > between that old way of doing things and the dj

specify the foreign keys in a ManyToManyField created table?

2012-07-04 Thread eiriks
I have a model that auto created an auto inc id field as primary key. It related smoothly with my person model, but when I try to create a relation to committees (Komiteer) I get a new intermediate table with (an auto inc primary key, that's ok, a working relation to commitees, smooth and *a non

Re: Use regular expression to retrieve all image tags from a given content

2012-07-04 Thread Melvyn Sopacua
On 4-7-2012 3:03, Tim Chase wrote: > r = re.compile(r""" > <# tag opening > \s* # optional whitespace > img # the tag > \b # must end here > (?: # one of these things: > \s+ # whitespace > (?:[a-z][a-z0-9]+:)?

Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-07-04 Thread Melvyn Sopacua
On 4-7-2012 9:55, ferran wrote: > Hello, > > I'm update javascript libraries: > - Jquery from > http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js to > http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js > - Jquery ui from > http://ajax.googleapis.com/ajax/libs/jqueryui

Re: Unable to obtain c.poll

2012-07-04 Thread Melvyn Sopacua
On 2-7-2012 23:37, Smaran Harihar wrote: > Also when we are taking, > > c = p.choice_set.filter(choice_text__startswith='Just hacking')>>> c.delete() > > > Are we deleting the object or just that filter queryset choice? The list returned by the filter. c = p.choice_set.get(..) c.delete() # cal

Re: map in django

2012-07-04 Thread kenneth gonsalves
On Wed, 2012-07-04 at 17:38 +0530, Satvir Toor wrote: > Hello!!! Everyone > I am new to maps in django.I want to display map in django application > and to capture the latitude and longitude for that location and to > save in database. Please give me reference. http://duckduckgo.com/?q=maps+in+d

Re: UserProfile.user" must be a "User" instance. django-registration

2012-07-04 Thread Melvyn Sopacua
On 2-7-2012 15:17, Nikhil Verma wrote: > Traceback:- > > > Exception Type: ValueError at /myprofile/completingprofile/ > Exception Value: Cannot assign " object at 0x3487c10>": "UserProfile.user" must be a "User" instance. > > user = request.user,# here i am trying to add user

Admin actions -- short_description as doc string?

2012-07-04 Thread Roy Smith
I'm just staring to explore admin actions. I'm surprised to see that you have to set the description by doing: my_action_function.short_description = "blah" wouldn't it be cleaner to just declare a doc string for the action function and have short_description grabbed from there? -- Roy Smith

map in django

2012-07-04 Thread Satvir Toor
Hello!!! Everyone I am new to maps in django.I want to display map in django application and to capture the latitude and longitude for that location and to save in database. Please give me reference. -- Satvir Kaur satveerkaur.blogspot.in -- You received this message because you are subscribe

Re: error : need more than 1 value to unpack

2012-07-04 Thread rafiee.nima
tnx ;) On Wednesday, July 4, 2012 1:03:37 PM UTC+4:30, Jon Black wrote: > > You're also returning mimetype="application/json" outside of the > request.is_ajax check. I doubt you want that. > On Wed, Jul 4, 2012, at 01:20, rafiee.nima wrote: > > Oh > I find out my mistake :D > > On Wednesday

onetoone relation question

2012-07-04 Thread ledzgio
Hi all, I have the following configuration: models.py http://dpaste.org/9q79R/ admin.py http://dpaste.org/w7CCD/ In admin I will get a select where for each player I can select (or add a new one) PlayerAttribute object. With the onetoone relation I have one PlayerAttribute for one Player but i

Re:

2012-07-04 Thread Jon Black
Do you mean github? If so, see the github documentation. Do you mean creating a git repository? If so, see the git documentation. -- Jon Black www.jonblack.org On Wed, Jul 4, 2012, at 02:25, Bharati Sharma wrote: I want to upload my project on the git ...kindly help me please.. -- You

[no subject]

2012-07-04 Thread Bharati Sharma
I want to upload my project on the git ...kindly help me please.. -- 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+uns

Re: error : need more than 1 value to unpack

2012-07-04 Thread Jon Black
You're also returning mimetype="application/json" outside of the request.is_ajax check. I doubt you want that. On Wed, Jul 4, 2012, at 01:20, rafiee.nima wrote: Oh I find out my mistake :D On Wednesday, July 4, 2012 12:38:11 PM UTC+4:30, rafiee.nima wrote: Hi I got below error from my view w

Re: error : need more than 1 value to unpack

2012-07-04 Thread rafiee.nima
Oh I find out my mistake :D On Wednesday, July 4, 2012 12:38:11 PM UTC+4:30, rafiee.nima wrote: > > Hi I got below error from my view which handle ajax request > hotel_instance=Hotel.objects.get(id=request.POST['hotel']) > need more than 1 value to unpack > > here is my code > > def add_room(r

error : need more than 1 value to unpack

2012-07-04 Thread rafiee.nima
Hi I got below error from my view which handle ajax request need more than 1 value to unpack here is my code def add_room(request): context={} status='' if request.is_ajax: if request.POST: hotel_instance=Hotel.objects.get(request.POST['hotel']) if r

Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-07-04 Thread ferran
Hello, I'm update javascript libraries: - Jquery from http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js to http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js - Jquery ui from http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js to http://ajax.googleap