Re: admin error, cannot edit fields or delete records, url refers to incorrect primary key

2012-05-19 Thread Malcolm MacKinnon
Problem solved. I had a double defined as my primary key in the mysql db. On Fri, May 18, 2012 at 10:49 PM, Mac wrote: > I've set up a 'Reps' model in the admin. I can add records > successfully, but if I try to change a record or field, I get a 404 > error. When I try to delete a record, I get

Tip for Geany users or those looking for lightweight IDE

2012-05-19 Thread graeme
All it needs is a quick Google to find it, but I missed it before. This tip on the Geany wiki on how to set it up to work with a syntax checker is veru useful - IMO it plugs the biggest gap in Geany's functionality: http://wiki.geany.org/howtos/check_python_code In fact you do not need use the sh

django-cms text_only_plugins problem

2012-05-19 Thread Иван Иванов
Hi all! I know that this is not exactly the right mailing list, but … I am trying to filter the allowed plugins in the TextPlugin with the text_only_plugins option in my settings.py. Despite of what I'm writing in the property, I get all available plugins allowed in the select box in the text plu

Re: Django in mobile devices

2012-05-19 Thread Mario Gudelj
Have a look at http://www.linuxjournal.com/article/10940 Also http://thedjangoforum.com/board/thread/879/django-python-on-a-standalone-android/ On 19 May 2012 00:54, Phang Mulianto wrote: > HI all, > > i recently see rhomobile.com , which running ruby in mobile devices, and > phonegap which use

Re: Customizing Django Admin Site

2012-05-19 Thread Aditya Sriram M
Umm.. yes to some extent... Can I make an html frame inside a cell, and then open another admin site inside it!? On Monday, 7 May 2012 20:01:15 UTC+5:30, francescortiz wrote: > > You can create pseudo fields in the admin > > class CarAdmin(admin.ModelAdmin) > list_display = ('name','custom_f

Re: Django in mobile devices

2012-05-19 Thread Phang Mulianto
Hi Mario, thanks for your response. i already know about sl4a . what i mean is, are there any known project that use django / mini django framework parts to build apps in mobile device, in this case android only or even multi device. this will be nice ... do mvc in mobile use python... i mean

Re: Use Django to implement my GUI!

2012-05-19 Thread Eugène Ngontang
When you're asking if my client/server already exist. You're talking about physical machines or applications/modules? - the machines where client module will run already exist and are used dayly. The client module will just be installed there and do what it has to do. - every body knows the browse

Re: 'Settings' object has no attribute 'ROOT_URLCONF'

2012-05-19 Thread doniyor
solved, i uninstalled both python and django and then installed them again, now it is working... i think it was a misunderstanding for OS as it had several versions of django installed several times and it got confused may be... anyway.. for those who will meet the problem, this advice is given.

Re: Django in mobile devices

2012-05-19 Thread Alec Taylor
I use Phonegap and Django I created my mobile app using my exposed REST API with JSON calls in JavaScript On Sat, May 19, 2012 at 7:08 PM, Phang Mulianto wrote: > Hi Mario, > > thanks for your response. > > i already know about sl4a . > > what i mean is, are there any known project that use djan

How to popup a window from admin site from the admin table's cell html content?

2012-05-19 Thread Aditya Sriram M
I have a function like this.. list_display = (..,get_link_to_users, ..) def get_link_to_users(self, obj): html_table = ' My Users ' % (obj.customer_id) print html_table return html_table get_link_to_fortress_users.short_description = 'Fortress Users' get_link_t

How to display a table (with full functionalities like sorting, num rows etc) within a cell?

2012-05-19 Thread Aditya Sriram M
I have an admin site with two models, Customer and Users with one-to-many relationship. Now when I display the customer in admin site, I wanted to display it's Users in a table format. Basic HTML formatted table works fine but its too rugged and not very attractive. Note: I do this by manually

Re: How to display a table (with full functionalities like sorting, num rows etc) within a cell?

2012-05-19 Thread Daniel Svonava
I don't think that this is easily doable, you would have to tweak both the views and templates. However, whenever I think that a nested table would be usable, I try to achieve the same functionality by implementing filters/search on the models I'd like to see nested. In your case, just add filt

How do I construct a queryset for this complex query?

2012-05-19 Thread Devin
I've got a complex query that uses a combination of Q objects and qargs to produce the following query: Note the T4 alias...this is central to the question. SELECT `t_answer`.`id`, `t_answer`.`question_id`, `t_answer`.`survey_id`, `t_answer`.`content_type_id`, `t_intanswer`.`answer_ptr_id`, `t_in

Re: JQuery .get new url is not updating the page

2012-05-19 Thread Lee Hinde
On May 18, 2012, at 8:24 PM, Furqan Malik wrote: > Thanks for the reply, > > You misunderstood my question. > > Passed_TestCases = data['Data1']; > Failed_TestCases = data['Data2']; > These values are fine, I am using them to create the table. > > My question is once these values come from vi

Can't submit picture through generic view form

2012-05-19 Thread Michael Ackerman
I have a generic view: class create_ticket(CreateView): model = ticket form_class = ticket_form template_name = "create_ticket.html" success_url = "/tickets/thanks/" and a form: class ticket_form(ModelForm): class Meta: model = ticket fields = ('title','descri

DB joining 3 tables in django admin, while searching on the primary table

2012-05-19 Thread Aditya Sriram M
Hi, again, my models are Customer, Users and Devices. I would like to search by Customer and retrieve all 'select_related' rows of all the three models. Eg. like this.. Customer1 User1 Device1 Customer1 User1 Device2 Customer1 User2 Device1 Customer1 User2 Device2 etc etc.. Is this possible in

Re: user.set_password('new password')

2012-05-19 Thread Timothy Makobu
user.save returns the function object, which is a valid statement, so Python wont raise an Exception. On Sat, May 19, 2012 at 9:23 AM, Min Hong Tan wrote: > hi.. > > thanks!! haha... didn't notice that. how can no error...prompt out one > > > On Fri, May 18, 2012 at 11:48 PM, Jonathan D. Ba

Re: Template: Foreign Key

2012-05-19 Thread Fady Kamal
actually it worked even without the the set.all ,thanks for help On Sat, May 19, 2012 at 4:51 AM, Kurtis Mullins wrote: > Whoops -- that might need to be 'house.people_set.all'. Sorry. > > > On Fri, May 18, 2012 at 10:50 PM, Kurtis Mullins > wrote: > >> Try something along these lines (Note: I'm

Django graphical query interface?

2012-05-19 Thread Lee
I'm in need of a graphical query interface for my Django app, similar to what OpenOffice Base and MS Access provide. Ideally it would allow the user to select a Django Admin action to perform on the returned results, or drill into the related records. I struck out with google and Django Packages. A

django on jb ipad

2012-05-19 Thread hone5t
greetings i have ipad 2 and i donwload both python,sqlite3 and lightpd and wonder if i can run django on it or not -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-

Re: Use Django to implement my GUI!

2012-05-19 Thread Eugène Ngontang
Hi Jani. I don't know why you say " 3) Are you now trying to figure out how to plug in Django in "Adming module/PC with GUI block"?" My admin module and the gui do not share anything. They are not on the same pc. Gui is for displaying and admin for the page content management like any web aplicati

Re: user.set_password('new password')

2012-05-19 Thread Min Hong Tan
thanks all :) On Sat, May 19, 2012 at 9:49 AM, Timothy Makobu wrote: > user.save returns the function object, which is a valid statement, so > Python wont raise an Exception. > > > On Sat, May 19, 2012 at 9:23 AM, Min Hong Tan wrote: > >> hi.. >> >> thanks!! haha... didn't notice that. how can

Re: Use Django to implement my GUI!

2012-05-19 Thread Eugène Ngontang
Hi Jani. I don't know why you say " 3) Are you now trying to figure out how to plug in Django in "Adming module/PC with GUI block"?" My admin module and the gui do not share anything. They are not on the same pc. Gui is for displaying and admin for the page content management as any Le 19 mai 2012

Generic views create_object and prefill form data?

2012-05-19 Thread Paul
I have a model like this: class Website(models.Model): user = models.ForeignKey(User) name = models.CharField(unique=True, max_length=32) And use a generic view to create new items: def website_create(request): return create_update.create_object( request = request, fo

bash error when trying to django_admin.py; not found -- FAQ not helping

2012-05-19 Thread Mike Manfrin
I just installed django 1.4 on my OSX.7 macbook running Python 2.7.1. I installed first via git, and when that didn't work, I downloaded the tar and unzipped/installed 1.4. I am specifically getting the error: -bash: django_admin.py: command not found However, in /usr/local/bin, django_admin.py

Re: What all does pinax provides us once you have used a starter project ?

2012-05-19 Thread Mario Gudelj
Your question has been answered on SO. On 20/05/2012 12:35 AM, "yugal" wrote: > > I am confused as I have a starter project with Pinax and it seems its over. > > I have mentioned my whole scenario in > http://stackoverflow.com/q/10569310/731963 > > Please elaborate and share your experiences wit

Re: Trying to Edit Existing Post; Can't Get Form to Display

2012-05-19 Thread DF
Perfect! That worked! Thank you so much! I was stumped. Your revisions were much simpler and easy to understand as well. I really appreciate when I can learn something, especially a more straightforward process that is less complex and achieves the same desired results. Thank you, again! On S

My context variables don't show in templates

2012-05-19 Thread Mohamed Turki
Hi, I have a view called home that searches for a user in my UserProfile model and returns the username. I add this username to the context variable and try to show it in the template. Pretty straightforward and simple, right? Well, here is my code first : def home(request): var = "" n

django forms - overriding constructor for changing field type depending by input

2012-05-19 Thread luke lukes
hi everyone. i need to overrid the constructor of a form: if i have some value in input, some fields has to be ChoiceField, otherwise they have to be CharField. here's the code: http://dpaste.com/750343/ but this way doesn't work. even if i declare fields before constructor as CharField and t

Re: Use Django to implement my GUI!

2012-05-19 Thread Marc Aymerich
On Sat, May 19, 2012 at 8:01 PM, Eugène Ngontang wrote: > Hi Jani. > I don't know why you say > > " 3) Are you now trying to figure out how to plug in Django in "Adming > module/PC with GUI block"?" > > My admin module and the gui do not share anything. They are not on the same > pc. > Gui is for

Re: Use Django to implement my GUI!

2012-05-19 Thread Eugène Ngontang
Yes you're right Marc! It's just that I wanted to mention the fact my application is not only a web site accessible via a web browser only, but a client-server application with web-based GUI. But now things are clear, we're all now ok with the problematic and with your help and great responses, i

Re: django forms - overriding constructor for changing field type depending by input

2012-05-19 Thread Mario Gudelj
Hey Luke, I don't think you need to return anything, especially not a super class. Try this http://dpaste.com/hold/750356/ Cheers, -m On 20 May 2012 10:06, luke lukes wrote: > hi everyone. i need to overrid the constructor of a form: if i have some > value in input, some fields has to be C

Re: bash error when trying to django_admin.py; not found -- FAQ not helping

2012-05-19 Thread Mario Gudelj
Hey Mike, If you go to Python shell and do "import django", do you get an error message and what is it? Also, the location of 2.7 is different to other versions. They used to be under /Library/Python/.. and 2.7 is under /System/Library/.. so you may want to check your paths. Also, try installing

Re: DB joining 3 tables in django admin, while searching on the primary table

2012-05-19 Thread Matt Schinckel
You may be able to use prefetch_related to do what you want: it will all depend upon your model structure. select_related is easier, but only follows an fk in one direction. Matt. On Sunday, May 20, 2012 12:27:57 AM UTC+9:30, Aditya Sriram M wrote: > > Hi, > > again, my models are Customer, Use

Re: What all does pinax provides us once you have used a starter project ?

2012-05-19 Thread yugal
I am still not satisfied with the answer I got.. So, is the starter project all that pinax provides ? On Saturday, 19 May 2012 18:51:17 UTC+5:30, yugal wrote: > > > I am confused as I have a starter project with Pinax and it seems its over. > > I have mentioned my whole scenario in > http://sta

Re: Can't submit picture through generic view form

2012-05-19 Thread Jian Chang
Your form need a attribute named enctype, and the value is multipart/form-data, try it. 在 2012-5-19 晚上10:55,"Michael Ackerman" 写道: > > I have a generic view: > > class create_ticket(CreateView): > model = ticket > form_class = ticket_form > template_name = "create_ticket.html" > suc