Re: How do I prevent delete from table that has foreign key references

2013-01-20 Thread Hannu Krosing

On 01/20/2013 08:12 PM, Subodh Nijsure wrote:

Hi,

Say I have model that comprises of Books and Authors. Where a book may 
have multiple authors and this has foreignkey in the books table.


Now how do I prevent deletion of an author record while the there is 
record in books table that has pointer an author record (via foreign key).


Do i need to do this via stored procedure/trigger on DB level or is 
there standard procedure to implement this in delete in django?


Any decent database enforces foreign keys automatically.

Hannu

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



Re: Help Required on DB Connection and Data Access

2013-05-03 Thread Hannu Krosing
On 05/03/2013 03:48 PM, Lakshmi Prasad wrote:
> Hi
>  
> I am new to Python-Django Development
>  
> we have one django application running on windows machine and DB which
> I needs to access is from Linux machine. First of all I want  to
> connect to Linux machine and I need to access the DB tables from  my
> windows machine. Please help me to write connection string and
> required parameters to be passed in order to access DB
connection string is just "host=xxx dbname=yyy port=5432"

most likely you also need on linux/database side to:

edit the port postgresql listens on in postgresql.conf (requires
postgresql restart)

and

edit pg_hba.conf to allow connections from your windows machine

--
Hannu

> -- 
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANNOUNCE: Django 1.6 beta 1 released

2013-06-29 Thread Hannu Krosing
On 06/28/2013 03:48 PM, Jacob Kaplan-Moss wrote:
> Hi folks --
>
> I'm pleased to announce that we've just released Django 1.6 beta 1,
> the second in our series of preview releases leading up to Django 1.6
> (due in August).
>
> More information can be found on our blog:
>
>  
>   https://www.djangoproject.com/weblog/2013/jun/28/django-16-beta-1-released/
>
> And in the release notes:
>
> https://docs.djangoproject.com/en/dev/releases/1.6/
Is there any hope to get https://code.djangoproject.com/ticket/6148
integrated int 1.6 ?

This is about using schemas in databases which support them well enough
(PostgreSQL, Oracle, ...)

Hannu Krosing

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Comments in real time

2014-08-20 Thread Hannu Krosing
On 08/20/2014 05:11 PM, Aaron Reabow wrote:
> Hi all,
>
> I use a proprietary application that let people on multiple browsers
> comment.
>
> In real time their comments are displayed for everyone to see.
>
> What is quite nice, is that you can then order and group these comments.
>
> I have looked through the Django apps, but am unsure if any of them
> will give me similar capabilities (or parts thereof).
>
> Would anyone have a suggestion on where to start looking.  My
> alternative would be to then build the interactivity in javascript.
You will be needing some Javascript anyway

Start by googling: socket.io django

Cheers

>
> many thanks in advance,
>
> Aaron
> -- 
> 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/80044c93-b217-4caa-8512-ad4265abd8f3%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/53F4BB5D.6000307%40krosing.net.
For more options, visit https://groups.google.com/d/optout.


Re: No modpython.py in python-django 1.6.6-1, which package includes modpython.py?

2014-09-17 Thread Hannu Krosing
On 09/17/2014 01:52 PM, nobody wrote:
>
> Hi,
>
> In Debian 6.0.4, I installed python-django  1.4.5-1 which got
> /usr/lib/python2.6/dist-packages/django/contrib/auth/handlers/modpython.py.
> That file is not included in python-django  1.6.6-1 for the Wheezy,
> and I've got following error from apache2. How can I fix it? Which
> package should I install to get the modpython.py?
Try libapache2-mod-python

Cheers
Hannu

-- 
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/54197DD6.5040007%40krosing.net.
For more options, visit https://groups.google.com/d/optout.


Re: Postgres database server

2014-10-13 Thread Hannu Krosing
On 10/13/2014 08:31 PM, sheyda kianimehr wrote:
> Yes, I did but when I want to run server python manage.py runserver
> I got this message
>
> django.db.utils.OperationalError: FATAL:  password authentication
> failed for user "postgres"
> FATAL:  password authentication failed for user "postgres"
>
> You think there is a problem with my DB?
> I have made a new DataBase and I can access that at terminal.
Do you actually access the database "at the terminal" as the user you
run django ?

Do you use the same address (IP vs. unix sockets) ?

>
> On Saturday, October 11, 2014 12:33:03 PM UTC-5, Thomas wrote:
>
>
> On Oct 11, 2014, at 10:10 AM, sheyda kianimehr  > wrote:
>
>> Hi guys I have a problem.
>> I am so new in Django and Postgres
>>
>> I am installed python, django, postgres on Ubuntu (acording to
>> https://docs.djangoproject.com/en/1.7/intro/tutorial01/
>> )
>> but I have problem in seting up The development server,
>> I see password for postgres user error after typing this is my
>> Terminal
>> python manage.py runserver
>>
>> I put a password in setting.py file but it doesn’t work yet.
> Are you sure that you are accessing the database through django
> the way the database expects?
>
> You should be able to access your database through the command line:
>
> psql -U your_db_username dbname
>
> Send your DATABASES variable from the settings file and we might
> have some more suggestions.
>
> hth
>
> - Tom
>
> -- 
> 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/625a4edc-ca2a-4f95-97de-81775824c974%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/543C33E2.1090207%40krosing.net.
For more options, visit https://groups.google.com/d/optout.


Re: jquery in included html file

2014-05-05 Thread Hannu Krosing
On 05/05/2014 09:30 AM, Andreas Bloch wrote:
> How do you access (or include) jquery in a file, which is included?
> I'm getting a "Uncaught ReferenceError: $ is not defined" when trying
> to use jquery in the included file...
Is jquery there when you look at the page source ?
>
> In my template, that extends base.html, I am able to use jquery but
> not the file I'm including with {% include 'nav.html' %} in the template.
>
> I could just put my 

Re: Transform list comprehension back to traditional looping construct, how?

2014-06-01 Thread Hannu Krosing
On 06/01/2014 03:00 PM, Pepsodent Cola wrote:
> At first I was trying to use list.append but then Python complained
> that append could only take 1 argument.  So I google around and
> list.extend said that it could take more arguments so I just went with it.
>
> What is this right method you are thinking about? 
list.append()

instead of

list.append(individual, tuple, elements)

> My imagination is very limited I only know of append but not sure how
> to work with it in this situation.
>
>
>
> On Sunday, June 1, 2014 2:52:33 PM UTC+2, Masklinn wrote:
>
>
> On 2014-06-01, at 14:29 , Pepsodent Cola  > wrote:
>
> > Hi, I want to transform my articles_list5 list comprehension
> back to a traditional looping construct to make things easier to
> read.
> > The articles_list5 returns a list of tuples.
> >
> > But when I try to do the same using traditional looping in
> articles_list6 then I just get one long list from everything.  How
> do I transform list5 to list6 correctly so it still returns a list
> of tuples?
>
> By using the right method? Why are you calling list.extend?
>
> -- 
> 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/095e6321-4337-4bcb-b55d-07a273f515fb%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/538B40B2.90907%40krosing.net.
For more options, visit https://groups.google.com/d/optout.


Re: Python Brasil[10]

2014-06-14 Thread Hannu Krosing
On 06/14/2014 05:20 AM, Renato Oliveira wrote:
> Hi all!
>
> My name is Renato Oliveira, I'm board member of Python Brazil
> Association and co-chair of the next Python Brasil Conference
> . This year the conf is taking place in
> Porto de Galinhas, Pernambuco  (for ten
> times in a row elected the most beautiful Brazilian beach) on Nov 4 -
> Nov 8 with some special activities (TBA) on November 9th.
>
> The tickets will be available on Monday, and we just announced our
> first keynote: Alex Gaynor
> 

>
> How can you help us? Attending, Spreading the word in your local
> groups and sponsoring the conference.
Is the Call for Proposals still open ?

I did not see neither schedule nor cCFP on the website.

Cheers
Hannu

> The prospectus is here
> .
>
> If you're planning to come to the conference and need help to find a
> place to stay, just need some tips or have any kind of doubt, please
> let me know.
>
> Best regards,
>
> Renato Oliveira
> @_renatooliveira 
> Labcodes - www.labcodes.com.br 
>
> -- 
> 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/CAGPLouW6Zj9jgvoxPot1%3D3q3-dVFr98QZdEbr%3DgNETVwygzOKQ%40mail.gmail.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/539C9017.2070008%40krosing.net.
For more options, visit https://groups.google.com/d/optout.