How to create a sessio in django

2013-07-08 Thread Sivaram R
I am learning django. I came accross the django doc about session. My question is for example if i am having the below models.py class Report(models.Model): user = models.ForeignKey(User, null=False) report_number = models.CharField('Incident Number', max_length=100) device_id = mode

Re: djangobook.com, chapter 5, __init__() got an unexpected keyword argument 'maxlength'

2013-07-08 Thread Nkansah Rexford
Several years since this question was asked, but really solved my problem today. I'm using 1.5 of django, and the maxlength (now max_length) thing was bugging me. Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from thi

Abstract models instrospection

2013-07-08 Thread Roberto Bouza
Hello, Hope someone can explain to me what is happening here? I have this models: *class InfrastructureBaseModel(models.Model):* *class Meta:* *abstract = True* *app_label = 'infrastructure'* * * *class ConsumerClasifications(InfrastructureBaseModel):* *product_envi

Re: Unable to do import django

2013-07-08 Thread Yves S. Garret
On Monday, July 8, 2013 6:11:36 PM UTC-4, Drew Ferguson wrote: > > On Mon, 8 Jul 2013 14:46:25 -0700 (PDT) > "Yves S. Garret" > wrote: > > > On Monday, July 8, 2013 5:18:21 PM UTC-4, Drew Ferguson wrote: > > > > > > Yo > > > > > > You have 2 versions of python installed: > > > > > > * pytho

Re: more testing questions

2013-07-08 Thread Javier Guerra Giraldez
On Mon, Jul 8, 2013 at 5:41 PM, Larry Martell wrote: > So if you don't use dump files, what do you do? Load data row by row > from within your test's setups? no, i mostly write the fixture data by hand. except when i need a series of records to cover a all (most?) combinations, then i generate

Re: more testing questions

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 4:21 PM, Javier Guerra Giraldez wrote: > On Mon, Jul 8, 2013 at 4:14 PM, Larry Martell wrote: >> It appesars it's trying to add a row to django_content_type and it's >> already there. I tried not loading the fixture for django_content_type >> but I got the same error. These

Re: more testing questions

2013-07-08 Thread Javier Guerra Giraldez
On Mon, Jul 8, 2013 at 4:14 PM, Larry Martell wrote: > It appesars it's trying to add a row to django_content_type and it's > already there. I tried not loading the fixture for django_content_type > but I got the same error. These fixture files contain data I dumped > from my real db, so I know it

Re: Unable to do import django

2013-07-08 Thread Drew Ferguson
On Mon, 8 Jul 2013 14:46:25 -0700 (PDT) "Yves S. Garret" wrote: > On Monday, July 8, 2013 5:18:21 PM UTC-4, Drew Ferguson wrote: > > > > Yo > > > > You have 2 versions of python installed: > > > > * python 2.6 installed probably in /usr/bin and > > using /usr/lib/python2.6 > > > > * python 2.7

Re: Unable to do import django

2013-07-08 Thread Yves S. Garret
On Monday, July 8, 2013 5:18:21 PM UTC-4, Drew Ferguson wrote: > > Yo > > You have 2 versions of python installed: > > * python 2.6 installed probably in /usr/bin and using /usr/lib/python2.6 > > * python 2.7 installed in /usr/local/bin and possibly /usr/lib/python2.7 > > You need to decide whi

Re: Unable to do import django

2013-07-08 Thread Drew Ferguson
Yo You have 2 versions of python installed: * python 2.6 installed probably in /usr/bin and using /usr/lib/python2.6 * python 2.7 installed in /usr/local/bin and possibly /usr/lib/python2.7 You need to decide which one you want to use and deal with the tools and binaries installed for the versi

Re: more testing questions

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 12:06 PM, Larry Martell wrote: > Still working on getting my tests to run. I have 2 issues right now: > > 1) I want to load data from fixture files. In this case I am trying to > load auth data to test the logins. I have this in my test code: > > from django.test import Test

Re: Return 2 values

2013-07-08 Thread Nick Apostolakis
On 08/07/2013 02:26 μμ, Hélio Miranda wrote: ok, I have my view like this: *def view(request, id):* *fs = mongoengine.fields.GridFSProxy()* *foto = fs.get(id=ObjectId(id))* *legenda = foto.legend* ** *array = [foto.read(), legenda]* *return HttpResponse(array)* But before

Re: Unable to do import django

2013-07-08 Thread Yves S. Garret
On Monday, July 8, 2013 4:36:17 PM UTC-4, larry@gmail.com wrote: > > On Mon, Jul 8, 2013 at 2:34 PM, Yves S. Garret > > wrote: > > On Monday, July 8, 2013 4:31:47 PM UTC-4, Yves S. Garret wrote: > >> > >> On Monday, July 8, 2013 4:03:12 PM UTC-4, larry@gmail.com wrote: > >>> > >>> On

Re: Unable to do import django

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 2:34 PM, Yves S. Garret wrote: > On Monday, July 8, 2013 4:31:47 PM UTC-4, Yves S. Garret wrote: >> >> On Monday, July 8, 2013 4:03:12 PM UTC-4, larry@gmail.com wrote: >>> >>> On Mon, Jul 8, 2013 at 2:00 PM, Yves S. Garret >>> wrote: >>> > On Monday, July 8, 2013 2:28:5

Re: Unable to do import django

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 2:31 PM, Yves S. Garret wrote: > On Monday, July 8, 2013 4:03:12 PM UTC-4, larry@gmail.com wrote: >> >> On Mon, Jul 8, 2013 at 2:00 PM, Yves S. Garret >> wrote: >> > On Monday, July 8, 2013 2:28:58 PM UTC-4, larry@gmail.com wrote: >> >> >> >> On Mon, Jul 8, 2013 at

Re: Unable to do import django

2013-07-08 Thread Yves S. Garret
On Monday, July 8, 2013 4:31:47 PM UTC-4, Yves S. Garret wrote: > > On Monday, July 8, 2013 4:03:12 PM UTC-4, larry@gmail.com wrote: >> >> On Mon, Jul 8, 2013 at 2:00 PM, Yves S. Garret >> wrote: >> > On Monday, July 8, 2013 2:28:58 PM UTC-4, larry@gmail.com wrote: >> >> >> >> On Mon,

Re: Unable to do import django

2013-07-08 Thread Yves S. Garret
On Monday, July 8, 2013 4:03:12 PM UTC-4, larry@gmail.com wrote: > > On Mon, Jul 8, 2013 at 2:00 PM, Yves S. Garret > > wrote: > > On Monday, July 8, 2013 2:28:58 PM UTC-4, larry@gmail.com wrote: > >> > >> On Mon, Jul 8, 2013 at 12:10 PM, Yves S. Garret > >> wrote: > >> > I've gone t

Re: Managing transactions using multiple databases

2013-07-08 Thread Leandro Boscariol
Amazing work Christophe, congrats! Lot's of new cool stuff being added to 1.6, looking forward to it. Regarding the nested xact context managers, let's say something that I don't like happened and I want to abort everything: with xact(using=db1): with xact(using=db2): obj1 = Ob1.save(

Re: Unable to do import django

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 2:00 PM, Yves S. Garret wrote: > On Monday, July 8, 2013 2:28:58 PM UTC-4, larry@gmail.com wrote: >> >> On Mon, Jul 8, 2013 at 12:10 PM, Yves S. Garret >> wrote: >> > I've gone through the entire django install steps and when I fired up my >> > Python shell >> > (python

Re: Unable to do import django

2013-07-08 Thread Yves S. Garret
On Monday, July 8, 2013 2:28:58 PM UTC-4, larry@gmail.com wrote: > > On Mon, Jul 8, 2013 at 12:10 PM, Yves S. Garret > > wrote: > > I've gone through the entire django install steps and when I fired up my > > Python shell > > (python 2.7.5, to be exact) and did import django, this is what I

Re: Unable to do import django

2013-07-08 Thread Yves S. Garret
Ok, just installed Django anew with pip (first did uninstall, then install). This is what I have: $ django-admin.py help Traceback (most recent call last): File "/usr/bin/django-admin.py", line 5, in management.execute_from_command_line() File "/usr/lib/python2.6/site-packages/django/cor

video app

2013-07-08 Thread Tcheck
Hello! Is there any way around for making a video chat app using django? Or even with python? Thanks you! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to djang

video app

2013-07-08 Thread Scheck Nyori
Hi, Is there any way then i can make a video chat app in django? I searched for this package but culdn't find. Please share your views. Thank you. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Unable to do import django

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 12:10 PM, Yves S. Garret wrote: > I've gone through the entire django install steps and when I fired up my > Python shell > (python 2.7.5, to be exact) and did import django, this is what I got: > import django > Traceback (most recent call last): > File "", line 1, i

Unable to do import django

2013-07-08 Thread Yves S. Garret
I've gone through the entire django install steps and when I fired up my Python shell (python 2.7.5, to be exact) and did import django, this is what I got: >>> import django Traceback (most recent call last): File "", line 1, in ImportError: No module named django sudo python setup.py install

more testing questions

2013-07-08 Thread Larry Martell
Still working on getting my tests to run. I have 2 issues right now: 1) I want to load data from fixture files. In this case I am trying to load auth data to test the logins. I have this in my test code: from django.test import TestCase from django.contrib.auth.models import User, Permission cla

Re: How to download the table generated in html as a file

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 11:10 AM, sahitya pavurala wrote: > Hi , > > Can you specify from where am i getting the data here . > Should I have to retrieve the data again from the database . > > my view function has this code : > if Mice.objects.filter(pk=item).exists() == False: >

Re: How to download the table generated in html as a file

2013-07-08 Thread sahitya pavurala
Hi , Can you specify from where am i getting the data here . Should I have to retrieve the data again from the database . my view function has this code : if Mice.objects.filter(pk=item).exists() == False: invalidlist.append(item) inputlist.remove(

Re: How to download the table generated in html as a file

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 10:30 AM, sahitya pavurala wrote: > > Hi , > > > I am new to Django and I would be glad if i can get help on this . > > I am generating a html page where i get a table containing fields and values > of a database . > I want to download this table as a file (preferably as an

How to download the table generated in html as a file

2013-07-08 Thread sahitya pavurala
Hi , I am new to Django and I would be glad if i can get help on this . I am generating a html page where i get a table containing fields and values of a database . I want to download this table as a file (preferably as an excel file ) . How can i do this ? Thanks for the help in advance .

Re: change buttons or widgets

2013-07-08 Thread Kakar Arunachal Service
Thank you so much That's just what i needed! And while i was searching for this, i came across this: django-crispy ( http://django-crispy-forms.readthedocs.org/en/1.1.1/index.html). Just wanted to share! On Mon, Jul 8, 2013 at 6:48 PM, Derek wrote: > Widgets: https://docs.djangoproject.com/

Re: unit testing

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 9:36 AM, Javier Guerra Giraldez wrote: > On Mon, Jul 8, 2013 at 10:13 AM, Larry Martell > wrote: >> I had seen the __init__ but I thought the tests had to be in the same >> dir as the models file. > > > the tests _module_ has to be in the same dir as the models module. > t

Re: unit testing

2013-07-08 Thread Javier Guerra Giraldez
On Mon, Jul 8, 2013 at 10:13 AM, Larry Martell wrote: > I had seen the __init__ but I thought the tests had to be in the same > dir as the models file. the tests _module_ has to be in the same dir as the models module. that means either a tests.py file, or a tests directory with an __init__.py f

Re: Django 1.5 runserver hangs in Chrome

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 9:16 AM, François Schiettecatte wrote: > Its the little gear at the bottom right, took me a while to find it. Got it! Thanks! > On Jul 8, 2013, at 11:10 AM, Larry Martell wrote: > >> On Mon, Jul 8, 2013 at 5:00 AM, Sven Bröckling wrote: >>> Hi, >>> >>> Chrome sometimes

Re: Django 1.5 runserver hangs in Chrome

2013-07-08 Thread François Schiettecatte
Its the little gear at the bottom right, took me a while to find it. F. On Jul 8, 2013, at 11:10 AM, Larry Martell wrote: > On Mon, Jul 8, 2013 at 5:00 AM, Sven Bröckling wrote: >> Hi, >> >> Chrome sometimes does really strange things. I use chrome with a disabled >> cache for development (Op

Re: unit testing

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 8:59 AM, wrote: > > > On Monday, July 8, 2013 7:49:53 AM UTC-4, larry@gmail.com wrote: >> >> >> >> Ah, I missed that in the docs. Thanks. When I renamed it to tests.py >> it got picked up. >> >> But in the django/contrib dirs (e.g. django/contrib/auth) the tests >> are

Re: Django 1.5 runserver hangs in Chrome

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 5:00 AM, Sven Bröckling wrote: > Hi, > > Chrome sometimes does really strange things. I use chrome with a disabled > cache for development (Open Developer Tools, click on the settings menu, > first option) which resolves this kind of problems for me. I'm frequently emptying

Re: unit testing

2013-07-08 Thread ben
On Monday, July 8, 2013 7:49:53 AM UTC-4, larry@gmail.com wrote: > > > > Ah, I missed that in the docs. Thanks. When I renamed it to tests.py > it got picked up. > > But in the django/contrib dirs (e.g. django/contrib/auth) the tests > are in a tests sub dir and are not called tests.py and

Re: Django 1.5 runserver hangs in Chrome

2013-07-08 Thread Sven Bröckling
Hi, Chrome sometimes does really strange things. I use chrome with a disabled cache for development (Open Developer Tools, click on the settings menu, first option) which resolves this kind of problems for me. Regards Sven I can confirm this issue. Exactly the same problem here. Also,

Re: Advanced search in django?

2013-07-08 Thread Kamal Kaur
On Sat, Jul 6, 2013 at 9:47 PM, Kamal Kaur wrote: > Sorry, didn't get you. > Can you please elaborate more? Reply awaited. -- Kamaljeet Kaur Blog:http://kamalkaur188.wordpress.com/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscr

bug or programmer error when using logging.config.fileConfig

2013-07-08 Thread Chris Curvey
I'm not sure if this is a bug or my error, but I'm trying to use a legacy logging configuration in my django 1.5 app, like so: LOGGING = r"C:\path\to\logging.conf" LOGGING_CONFIG="logging.config.fileConfig" when I try to start my app, I'm getting ConfigParser.NoSectionError: No section: 'format

Re: change buttons or widgets

2013-07-08 Thread Derek
Widgets: https://docs.djangoproject.com/en/dev/ref/forms/widgets/ For changing the way buttons look; try Twitter Bootstrap: http://twitter.github.io/bootstrap/components.html -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: menu highlight issue in django

2013-07-08 Thread roopasingh250
Hi, Since i am using session in my application i planed to check with the use of session.See my edit method for editing the report. The idea is i need to create another session for edit method and if that created session is their,the menu should not highlighted,so if a user is going to open

Re: unit testing

2013-07-08 Thread Larry Martell
On Sun, Jul 7, 2013 at 10:05 PM, Javier Guerra Giraldez wrote: > On Sun, Jul 7, 2013 at 10:47 PM, Larry Martell > wrote: >> MeasDataTest is declared as: >> >> class MeasDataTest(TestCase): >> >> Why do I get "does not refer to a test"? > > where do you define your test? AFAIR, it must be either

Re: Return 2 values

2013-07-08 Thread Hélio Miranda
ok, I have my view like this: *def view(request, id):* *fs = mongoengine.fields.GridFSProxy()* *foto = fs.get(id=ObjectId(id))* *legenda = foto.legend* ** *array = [foto.read(), legenda]* *return HttpResponse(array)* But before I had to go to the image url this: *url(r'^vie

Re: type object 'DataTable' has no attribute 'datFile'

2013-07-08 Thread Daniel Roseman
On Monday, 8 July 2013 10:36:57 UTC+1, Nigel Legg wrote: > Thanks Daniel. > Before trying that, I went nto the python shell, imported the DataTable > model, and tried DataTable.objects.all(), and got the error: > DatabaseError: no such column: myapp_datatable.datFile. > I tried re-running syncd

Re: type object 'DataTable' has no attribute 'datFile'

2013-07-08 Thread Nigel Legg
Thanks Daniel. Before trying that, I went nto the python shell, imported the DataTable model, and tried DataTable.objects.all(), and got the error: DatabaseError: no such column: myapp_datatable.datFile. I tried re-running syncdb, but still get the same error. Am I using reserved names here, or is

Re: Javascript AJAX url call not responding

2013-07-08 Thread nesornet
> "Either way I cannot get the ajax call to succeed in triggering the django > backend at all" > By "django backend" I simply mean the persistent_messages/views.py, which should be referenced when the ajax url calls /messages/marked_read/X (as defined in persistent_messages/urls.py. Again a

Re: Javascript AJAX url call not responding

2013-07-08 Thread nesornet
I added the getcookie call to grab csrftoken (ref from the link you provided), but the farthest I can get is by setting ajax async:false which causes the status reported by chrome developer tools (for call /messages/marked_read/X ) to be PENDING. Without async:false, it just goes to CANCELLED.