Re: New to Django question about using it without ORM

2014-11-07 Thread Aliane Abdelouahab
and here is an excellent tutorial on python 2.7 :
http://www.tangowithdjango.com/book17/

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7619c736-6174-4f37-b435-0dd3d14a3924%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to Django question about using it without ORM

2014-11-07 Thread Aliane Abdelouahab
if you are in twisted, why you dident look at tornado?

Le vendredi 7 novembre 2014 21:38:48 UTC+1, krmane a écrit :
>
> On 11/08/2014 01:46 AM, Aliane Abdelouahab wrote: 
> > - Django 1.7 has the features people always waited it, the the 'migrate' 
> > which allows you to change your schema and let Django rédapate it :) 
> In my project, all the core logic and database queries (using sqlalchemy 
> ) are in a different rpc based service written in twisted. 
> I don't need the model part of Django, just the views to get or send 
> data to the rpc service called the core_engine and get data from there 
> and send to dum html templates. 
>
> > - the orm is independant, you can directly write raw sql if you want, 
> the 
> > orm has been made for people who are not made to learn sql again, and to 
> > stay in object programming. 
> Again as I mentioned, I don't need to think about databses or models at 
> all, I just need to do the frontend logic here, it will have very 
> minimal processing in views and of course templates will make good use 
> of AJAX and JSON. 
>
> > - for python 2.7 i think all tutorials make it to work on 2.x because 
> not 
> > all the packages have migrated to python 3 (i talk about third parties), 
> > the difference in tutorials, is about using the unicode . 
> > 
>
> Can you give me one example where the difference will be obvious? 
> If the syntax from the official 1.7 tutorial can work with Python 2.7 
> out of the box, then I will hav no issues lerning directly with version 
> 1.7. 
> I just wish to only elaborate the fact that I only need to use the views 
> as the middle layer between the templates on one side (the client facing 
> side ) and the logic in a Python based core_engine written in xmlrpc. 
>
> If I am not loosing out the ease by which templates can be built using 
> Django and some libraries like krispy-forms then I am more than happy. 
> I would ideally love to have integrated libraries generate good deal of 
> css for me to make forms look good and be accessible. 
> Happy hacking. 
> Krishnakant. 
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3a360e70-1b78-4938-a787-11e4e698af7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to Django question about using it without ORM

2014-11-07 Thread Krishnakant Mane

On 11/08/2014 01:46 AM, Aliane Abdelouahab wrote:

- Django 1.7 has the features people always waited it, the the 'migrate'
which allows you to change your schema and let Django rédapate it :)
In my project, all the core logic and database queries (using sqlalchemy 
) are in a different rpc based service written in twisted.
I don't need the model part of Django, just the views to get or send 
data to the rpc service called the core_engine and get data from there 
and send to dum html templates.



- the orm is independant, you can directly write raw sql if you want, the
orm has been made for people who are not made to learn sql again, and to
stay in object programming.
Again as I mentioned, I don't need to think about databses or models at 
all, I just need to do the frontend logic here, it will have very 
minimal processing in views and of course templates will make good use 
of AJAX and JSON.



- for python 2.7 i think all tutorials make it to work on 2.x because not
all the packages have migrated to python 3 (i talk about third parties),
the difference in tutorials, is about using the unicode .



Can you give me one example where the difference will be obvious?
If the syntax from the official 1.7 tutorial can work with Python 2.7 
out of the box, then I will hav no issues lerning directly with version 1.7.
I just wish to only elaborate the fact that I only need to use the views 
as the middle layer between the templates on one side (the client facing 
side ) and the logic in a Python based core_engine written in xmlrpc.


If I am not loosing out the ease by which templates can be built using 
Django and some libraries like krispy-forms then I am more than happy.
I would ideally love to have integrated libraries generate good deal of 
css for me to make forms look good and be accessible.

Happy hacking.
Krishnakant.

--
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/545D2DB4.4060908%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to Django question about using it without ORM

2014-11-07 Thread Krishnakant Mane

On 11/08/2014 01:44 AM, Andreas Kuhne wrote:
A couple of your questions answered: 1. You don't need to use Django's 
ORM, but you will not be able to use certain features, for example the 
model based class based views (ListView, DetailView, UpdateView). 2. To 
use djangos views and templates, you should really first understand 
Djangos MVC philosophy. In the view you should get all of the items you 
want to show to the user and make the template as "dumb" as possible. It 
should ideally not have any advanced logic in it (think of dumb HTML).
Yes I am aware of this philosophy.  Infact I have all my core business 
logic in my xmlrpc service based engine which is actually the real software.
Thus my views will only query the APIS (getters and setters etc) and 
either send data to the templates or get data from templates and send to 
the core rpc engine.
SO I wonder for such a minimalistic  middle layer logic, do I need a lot 
of special features of views?
3. No comment on the forms (haven't used them), but it shouldn't be that 
hard to implement. 4. The difference between Python 2 and Python 3 has 
been easier from version 3 to version 2. I don't think you will have 
that much problems using python 2 instead of python 3 in the tutorials. 
And if you do, it shouldn't be that hard to fix. Django 1.7 requires at 
least version 2.7 though.

yes I do work with only Python 2.7.
The only thing I am not understanding is that in the tutorial it says 
"if you are still using Python 2.7 you will need some changes in the 
code, for more details see the comments ".

I did not say any special comments so far.
Can you please tell me which things should I look out as pitfalls.
And except the migrate system instead of syncdb, do we have some other 
things which are fundamentally different from Django 1.6?

happy hacking.
Krishnakant.

--
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/545D2B56.1000304%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to Django question about using it without ORM

2014-11-07 Thread Aliane Abdelouahab
- Google groups hide your email so crawler dont use it to gather emails for 
spams.
- Django 1.7 has the features people always waited it, the the 'migrate' 
which allows you to change your schema and let Django rédapate it :)
- the orm is independant, you can directly write raw sql if you want, the 
orm has been made for people who are not made to learn sql again, and to 
stay in object programming.
- for python 2.7 i think all tutorials make it to work on 2.x because not 
all the packages have migrated to python 3 (i talk about third parties), 
the difference in tutorials, is about using the unicode .



Le vendredi 7 novembre 2014 20:35:25 UTC+1, krmane a écrit :
>
> Hello all,
> I am absolutely new to Django.
> I am really impressed with it's features.
> I have used Pylons before, but I realise now that it just does not fit my 
> way of doings things.
> I am into writing financial applications.
> As a matter of Fact I have GNUKhata a free and open source accounting 
> software which I did develop with Pylons.
> However my core logic is a separate xmlrpc package developed using twisted.
> I have a desktop based (browserless ) frontend for the same core logic 
> module writen in SWT Java.
> But now I wish to revamp the entire webapp from pylons to Django.
> Now I have a few questions.
> 1, I don't wish to use Django's ORM, because I won't write my models in 
> Django.  They have been taken well care of in my xmlrpc based Python 
> backage.
> 2, I only need to make use of the control logic (view as I understand ) 
> and the templates.  For this I wish to know if this can be done.
> 3, I have herd about krispy-forms, any views on using them to make my ajax 
> calls as well as forms?
> 4, I am looking at the Django tutorial for version 1.7, it says tutorial 
> is ment for Python 3X.  How can I get a tutorial for Django 1.7 but for 
> Python 2.7X?
> It is just a requirement which I am not able to do away with so I will 
> need a tutorial for Python 2.7.
> Or do you guys still recommend me to go with Django 1.6 for this given 
> case?
> Lastly, Please if possible mail your replies to my email directly, I am a 
> totally blind programmer and the google interface is not that good.
> I like mails dropping into my Thunderbird inbox so that I can reply them 
> easily.
> Happy ahcking.
> Krishnakant.
>
>
>
>
>
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/41e3c863-182f-4aa2-97ef-9f3a73b27092%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to Django question about using it without ORM

2014-11-07 Thread Andreas Kuhne
2014-11-07 20:35 GMT+01:00 krmane :

> Hello all,
> I am absolutely new to Django.
> I am really impressed with it's features.
> I have used Pylons before, but I realise now that it just does not fit my
> way of doings things.
> I am into writing financial applications.
> As a matter of Fact I have GNUKhata a free and open source accounting
> software which I did develop with Pylons.
> However my core logic is a separate xmlrpc package developed using twisted.
> I have a desktop based (browserless ) frontend for the same core logic
> module writen in SWT Java.
> But now I wish to revamp the entire webapp from pylons to Django.
> Now I have a few questions.
> 1, I don't wish to use Django's ORM, because I won't write my models in
> Django.  They have been taken well care of in my xmlrpc based Python
> backage.
> 2, I only need to make use of the control logic (view as I understand )
> and the templates.  For this I wish to know if this can be done.
> 3, I have herd about krispy-forms, any views on using them to make my ajax
> calls as well as forms?
> 4, I am looking at the Django tutorial for version 1.7, it says tutorial
> is ment for Python 3X.  How can I get a tutorial for Django 1.7 but for
> Python 2.7X?
> It is just a requirement which I am not able to do away with so I will
> need a tutorial for Python 2.7.
> Or do you guys still recommend me to go with Django 1.6 for this given
> case?
> Lastly, Please if possible mail your replies to my email directly, I am a
> totally blind programmer and the google interface is not that good.
> I like mails dropping into my Thunderbird inbox so that I can reply them
> easily.
> Happy ahcking.
> Krishnakant.
>
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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2c5faea9-5522-42e5-982b-09334ee75aff%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

Hi,

A couple of your questions answered:
1. You don't need to use Django's ORM, but you will not be able to use
certain features, for example the model based class based views (ListView,
DetailView, UpdateView).
2. To use djangos views and templates, you should really first understand
Djangos MVC philosophy. In the view you should get all of the items you
want to show to the user and make the template as "dumb" as possible. It
should ideally not have any advanced logic in it (think of dumb HTML).
3. No comment on the forms (haven't used them), but it shouldn't be that
hard to implement.
4. The difference between Python 2 and Python 3 has been easier from
version 3 to version 2. I don't think you will have that much problems
using python 2 instead of python 3 in the tutorials. And if you do, it
shouldn't be that hard to fix. Django 1.7 requires at least version 2.7
though. If you find that going through the tutorial with python 3 doesn't
work, try to do the 1.6 tutorial with 2.7 first and then try the 1.7
tutorial. You will get the hang of things and should be able to see where
the problems are.

Good luck!

Regards,

Andréas

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALXYUbmn_Cfy1z_gBcFxNT-7AOuuucrTDa2HSfL5__Otpjx3jA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


New to Django question about using it without ORM

2014-11-07 Thread krmane
Hello all,
I am absolutely new to Django.
I am really impressed with it's features.
I have used Pylons before, but I realise now that it just does not fit my 
way of doings things.
I am into writing financial applications.
As a matter of Fact I have GNUKhata a free and open source accounting 
software which I did develop with Pylons.
However my core logic is a separate xmlrpc package developed using twisted.
I have a desktop based (browserless ) frontend for the same core logic 
module writen in SWT Java.
But now I wish to revamp the entire webapp from pylons to Django.
Now I have a few questions.
1, I don't wish to use Django's ORM, because I won't write my models in 
Django.  They have been taken well care of in my xmlrpc based Python 
backage.
2, I only need to make use of the control logic (view as I understand ) and 
the templates.  For this I wish to know if this can be done.
3, I have herd about krispy-forms, any views on using them to make my ajax 
calls as well as forms?
4, I am looking at the Django tutorial for version 1.7, it says tutorial is 
ment for Python 3X.  How can I get a tutorial for Django 1.7 but for Python 
2.7X?
It is just a requirement which I am not able to do away with so I will need 
a tutorial for Python 2.7.
Or do you guys still recommend me to go with Django 1.6 for this given case?
Lastly, Please if possible mail your replies to my email directly, I am a 
totally blind programmer and the google interface is not that good.
I like mails dropping into my Thunderbird inbox so that I can reply them 
easily.
Happy ahcking.
Krishnakant.






-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2c5faea9-5522-42e5-982b-09334ee75aff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: running unit tests with legacy database: Error 1050, Table already exists

2014-11-07 Thread dpalao . python
I think I should start a new thread. It is a different problem, after all.

On Thursday, November 6, 2014 5:13:09 PM UTC+1, David Palao wrote:
>
> Hi Collin, 
> Thanks a lot for the answer. I think you are right, and that was what 
> I was doing. Still, apparently the models could not be created 
> properly, or whatever. 
>
> However I think I managed to convert this problem to a different one 
> (not sure if I should start a new thread). 
> What I did was: remove the __pycache__ dirs, remake the migrations, 
> and remove some models that were created by inspectdb (django 
> related). 
>
> Now, the original problem has gone, BUT something (related, I think) 
> happens. With _meta.managed=False in my models I get 
> ... 
> django.db.utils.ProgrammingError: Table 'test_job_mon.job_info' doesn't 
> exist 
>
> The test I'm running is very simple: 
>
> class HomePageTest(TestCase): 
> def setUp(self): 
> from django.db.models.loading import get_models 
> self.unmanaged_models = [m for m in get_models() if not 
> m._meta.managed] 
> for m in self.unmanaged_models: 
> m._meta.managed = True 
>
> def tearDown(self): 
> for m in self.unmanaged_models: 
> m._meta.managed = False 
>
> def test_there_are_no_job_items_in_empty_db(self): 
> njobs = JobInfo.objects.count() 
> self.assertEqual(njobs, 0) 
>
>
>
> The relevant model: 
>
> class JobInfo(models.Model): 
> job_db_inx = models.IntegerField(primary_key=True) 
> id_job = models.IntegerField() 
> id_user = models.IntegerField() 
> id_group = models.IntegerField() 
> account = models.TextField(blank=True) 
> cpus_req = models.IntegerField() 
> cpus_alloc = models.IntegerField() 
> nodelist = models.TextField() 
> nodes_alloc = models.IntegerField() 
> partition = models.TextField() 
> time_start = models.IntegerField() 
> time_end = models.IntegerField() 
> was_updated = models.IntegerField() 
> jobmondatacleared = 
> models.IntegerField(db_column='jobMonDataCleared')  # Field name made 
> lowercase. 
> endupcount = models.IntegerField(db_column='endUpCount')  # Field 
> name made lowercase. 
> approved = models.IntegerField() 
>
> class Meta: 
> managed = False 
> db_table = 'job_info' 
>
>
> Now, if I comment the line "managed = False" and run makemigrations, 
> the test passes. 
>
> But I have checked that "managed" is switched to True during the tests. 
>
> Any ideas? 
>
> Thanks in advance, 
>
> David 
>
> 2014-11-05 18:45 GMT+01:00 Collin Anderson : 
> > Hi David, 
> > 
> > Interesting. Shouldn't the test database be a separate, fresh, empty 
> > database (not a legacy database)? 
> > 
> > Thanks, 
> > Collin 
> > 
> > -- 
> > 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 django-users+unsubscr...@googlegroups.com. 
> > To post to this group, send email to django-users@googlegroups.com. 
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/b79d8ab2-38ef-489d-9563-c2474c58defb%40googlegroups.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/144f19ac-f4de-4398-8beb-a29cbbf82d45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie operational error with Django db tables

2014-11-07 Thread Mr. crazy
I have executed [1] and tried again but no luck, the issues persists

I know that "downloads" table is missing yet I didn't in DionaraFR guithub 
 anything regarding that table. 
That what specifically makes me wonder if I have to build that missing 
table, what would I have to name its fields, 

On Friday, November 7, 2014 7:14:09 PM UTC+8, Adailton Nascimento wrote:
>
> The error that is giving and following this saying in your settings.py in 
> APPS not contain the "downloads" or if you already have to add it only in 
> the database, delete your database and run the shell [1].
>
> or just run the command in the shell [1] I believe that updates the 
> database without having to delete it.
>
> [2] this by saying that there is not a table in your database, then you 
> have to add it in settings.py and run the command, the error's there.
>
> If the error persists, place your project in git so we can take a look 
> deeper.
>
> [1] python manage.py syncdb
>
> [2] ( Exception Value: no such table: downloads )
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b625cb2e-3be9-4e0f-a65e-3ce5851bf4e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Whoosh autocomplete search logging for future analysis

2014-11-07 Thread Radek Svarz
Hi,

what is the best practice to setup the logging of search autocomplete 
logging for future analysis? 

When using Whoosh as a search engine and django.

The search is searching within hundred thousands of product names.

We want to get the insight on typos and typical name abbreviations.

The autocomplete searches are performed using AJAX requests to /search/ URL.

Thanks.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b9943bb0-fc6c-4bff-86cc-45f1dd28c1df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django auto fill recipient in Django_messages

2014-11-07 Thread Ronaldo Bahia


I'm building a job board and I'm using django_messages for private 
messages. It works great but I want to auto fill the recipient form field 
with the username and I don't know why.

Some thoughts?
http://stackoverflow.com/questions/26804088/django-auto-fill-recipient-in-django-messages

Thanks

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0d8a3126-4868-42f6-a854-216bebcc5e67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django 1.7 - help with change in "Save as new" behavior when related inlines are marked to be deleted

2014-11-07 Thread Jonathan Morgan
Hello,

I have an Event model (for an event like a concert or a play) that can have 
many Event_Dates (different showing dates and times of the concert of 
play).  The model relation is implemented with a ForeignKey from the 
Event_Date model to the Event.

In the django admins, I have the Event_Dates included as an inline in the 
Event admin page.  The inline code:

class EventDateInline( admin.StackedInline ):

model = Event_Date
extra = 2
fk_name = 'event'
fieldsets = [
( None,
{
'fields' : [ 'start_date', 'start_time', 'end_time' ]
}
),
( "Optional End Date and Description",
{
'fields' : [ 'end_date', 'description' ],
'classes' : ( "collapse", )
}
),
]

#-- END EventDateInline StackedInline class --#

And the code where the inline is included in the Event:

inlines = [
#EventPresenterInline,
EventDateInline,
EventImageInline,
]


Pretty standard stuff based on what I know of django.

When the users of this application need to make a new Event that is an 
annual update of an event that is put on once each year (the Nutcracker, 
for instance - multiple performances every December), they go to last 
year's Event in the admin, check the "delete" checkbox next to all but one 
of the dates, then use the "Save as new" button to make a new Event.

This worked fine in django versions 1.2 through 1.6.  A new event was 
created with one new date.  In 1.7, when one does this, one gets the 
following error:

TypeError at /path/to/event/edit/

Model instances without primary key value are unhashable

Request Method: POST
Request URL:http://example.com/path/to/event/edit/
Django Version: 1.7.1
Exception Type: TypeError
Exception Value:

Model instances without primary key value are unhashable

Exception Location:   
 /path/to/virtualenv/lib/python2.7/site-packages/django/db/models/base.py 
in __hash__, line 485
Python Executable:  /usr/bin/python
Python Version: 2.7.8 


In looking online, the one post I found that might be related is:

http://stackoverflow.com/questions/26081146/django-1-7-passing-around-unsaved-instances-throws-unhashable-exception

But in my case, while there is a signal associated with Event (on save, it 
looks up related Event Presenters, creates a string list of their names, 
then places that string in a field in the Event), it isn't anywhere in the 
stack trace for the error (below).

Initially, if anyone could help me figure out if this is a behavior that 
has changed in django versus one that might be related to my code, I'd 
appreciate it.  I tried disabling all the signals in my application (there 
are 4 - I removed them from my code-base entirely, then rebooted the server 
to make sure apache and wsgi were looking at the current code) and the 
problem persisted.

I honestly was surprised that it used to work, am trying to figure out what 
to tell the user.  For now, "Save as new" where one does not remove any 
Event_Dates works, so I advised the user to just do that, then update dates 
as needed in the new record.

Any help will be greatly appreciated.

Thanks,

Jon

==
stack trace:
==

Traceback:
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/core/handlers/base.py" 
in get_response
  111. response = wrapped_callback(request, 
*callback_args, **callback_kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/contrib/admin/options.py"
 
in wrapper
  584. return self.admin_site.admin_view(view)(*args, 
**kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapped_view
  105. response = view_func(request, *args, **kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/views/decorators/cache.py"
 
in _wrapped_view_func
  52. response = view_func(request, *args, **kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/contrib/admin/sites.py" 
in inner
  204. return view(request, *args, **kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/contrib/admin/options.py"
 
in change_view
  1457. return self.changeform_view(request, object_id, form_url, 
extra_context)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapper
  29. return bound_func(*args, **kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapped_view
  105. response = view_func(request, *args, **kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/utils/decorators.py" 
in bound_func
  25. return func.__get__(self, type(self))(*args2, 
**kwargs2)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/db/tran

Where does django store auth migrations?

2014-11-07 Thread Dr Ed
Hi all,

I feel a bit embarrassed even asking this question, because it must have an 
obvious answer... but when I do "./manage.py migrate -l" I see:


*admin*

 [X] 0001_initial

*auth*

 [X] 0001_initial

 [X] 0002_customer_payingcustomer_projectmanager_staff

 [X] 0003_auto_20141107_0803

*contenttypes*

 [X] 0001_initial

*portal*

 [X] 0001_initial

 [X] 0002_auto_20141008_2032

 [X] 0003_auto_20141008_2058

 [X] 0004_auto_20141008_2100

 [X] 0005_auto_20141008_2102

 [X] 0006_auto_20141008_2259

 [X] 0007_project_project_video_url

*sessions*

 [X] 0001_initial



*Where do I find the auth migrations?* I've used grep, find and 
Spotlight... I've searched the repository. I just can't find them! What am 
I missing?

As a bit of background - the reason I'm doing this is we want to migrate to 
custom user models (removing username and just using email). However when I 
do this, I get "TypeError: Staff cannot proxy the swapped model 
'emailcustomuser.User'.
"

We don't actually need the proxy users, so I tried deleting them, but this 
didn't change anything (possibly because of these migrations I can't find). 

Cheers,

Ed

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ce688047-4e81-4ad8-bd71-115e9ca05ef9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


HStoreField can't adapt type 'dict'

2014-11-07 Thread Vedran Čačić
I know it's very early release, but I'd expect the example from the docs to 
work. I started playing with HStoreField from 
django.contrib.postgres.fields, and get the error above. Model Dog is 
copied verbatim from 
https://docs.djangoproject.com/en/dev/ref/contrib/postgres/fields/#querying-hstorefield,
 
and then in the shell, 

>>> from atest.models import Dog
>>> Dog.objects.create(name='Rufus', data={'breed': 'labrador'})
...
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: can't adapt type 'dict'

At that moment,

sql = 'INSERT INTO "atest_dog" ("name", "data") VALUES (%s, %s) 
RETURNING "atest_dog"."id"'
params = ('Rufus', {'breed': 'labrador'})

So, everything should be completely normal - yet, HStoreField somehow 
doesn't know how to accept dict, despite docs saying that it's exactly what 
it should accept. Does anyone have any advice? Has anyone tried to do 
something with HStoreField?

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d891d17f-3978-43fb-ae85-8dea13855a57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Integrate Google Cloud Sql.

2014-11-07 Thread Daljit Singh
Hello, 

Greetings ..!!

I need to integrate Google Cloud Sql to my django app. Can anybody light me 
a right way.

*Thanks and Regards:*
*Daljit Singh.*
*daljit_si...@esferasoft.com*

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1839e63e-f19c-4ee8-bdec-18d4535c2632%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Advanced Tutorial (how to write reusable app), last step does not work

2014-11-07 Thread Dennis Kao
Hi 

I just face this same issue and stuck in it for few days, than find out the 
TEMPLATE_LOADERS 
setting,

by default it has two way to find templates:

'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader'


but the 

'django.template.loaders.eggs.Loader',

is disable by default,

so, just add these codes to setting.py

TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.eggs.Loader'
)


than it works fine :)





-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f18e170d-09f1-4758-8261-f216aae40e0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Page reload hang using django (python 2.7 in linux)

2014-11-07 Thread Mark Adward
I developed a web app to image process using python django framework. The 
app woks fine in windows But the problem i am facing on linux operating 
system. When i start the server using command:- python manage.py runserver 
, The app works only for the first time then When i click reload on the 
browser it stuck on loading and never load the page. Server is aloso 
running on background what i have to kill using command : sudo fuser -k 
8000/tcp. Can any one tell me what is the problem ?

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c397d0d7-1359-4c8e-ab9c-2eeb65a78d3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie operational error with Django db tables

2014-11-07 Thread Adailton Nascimento
The error that is giving and following this saying in your settings.py in 
APPS not contain the "downloads" or if you already have to add it only in 
the database, delete your database and run the shell [1].

or just run the command in the shell [1] I believe that updates the 
database without having to delete it.

[2] this by saying that there is not a table in your database, then you 
have to add it in settings.py and run the command, the error's there.

If the error persists, place your project in git so we can take a look 
deeper.

[1] python manage.py syncdb

[2] ( Exception Value: no such table: downloads )

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/356d95b2-33b3-43ad-95a3-31a59eba37af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django strange behaviour

2014-11-07 Thread Erik Cederstrand

> Den 07/11/2014 kl. 10.08 skrev termopro :
> 
> I have a view in Django which calls external library/class. The problem is 
> that for some reason Django keeps caching results coming from previous calls 
> of that class.

This is expected Python behaviour -  see 
https://docs.python.org/3/tutorial/classes.html#class-and-instance-variables

To start with an empty result list on every class instantiation, you need to 
stick it into __init__:

class Demo():
def __init__(self):
self.result = []

def do_something(self):
self.result.append(1)


Erik

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CF469FF4-BDD9-4925-BEC5-DE3A1142AA35%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.


Django strange behaviour

2014-11-07 Thread termopro
 

I have a view in Django which calls external library/class. The problem is 
that for some reason Django keeps caching results coming from previous 
calls of that class.

Please consider the following simple example:

Django view:

from some_path import Demodef test_view(request):
demo = Demo()
result = demo.do_something()
return render(request, 'test.html',
{ 'result':result }
)

Demo class:

class Demo():
result = []

def do_something(self):
self.result.append(1)
self.result.append(2)
self.result.append(3)
return self.result

You expect result to be [1, 2, 3], right ? WRONG!

The first time a page is loaded you'll get the correct result. But on all 
following requests it will keep incrementing: [1, 2, 3, 1, 2, 3]... [1, 2, 
3, 1, 2, 3, 1, 2, 3] ...

So my question is obvious - what is going on here ? How do i receive [1, 2, 
3] every time i call a class inside Django view ?

p.s. - Django 1.7 / MacOSx

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/72ee993f-cc34-4aee-9455-694b09148d8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.