Newbie

2024-05-03 Thread Cindy Pearl Soriano
Hello everyone, can somebody help how to make an interactive site sor 
logging system?
-- 
---*DISCLAIMER AND CONFIDENTIALITY NOTICE* The Mindanao State 
University-Iligan Institute of Technology  
(MSU-IIT) makes no warranties of any kind, whether expressed or implied, 
with respect to the MSU-IIT e-mail resources it provides. MSU-IIT will not 
be responsible for damages resulting from the use of MSU-IIT e-mail 
resources, including, but not limited to, loss of data resulting from 
delays, non-deliveries, missed deliveries, service interruptions caused by 
the negligence of a MSU-IIT employee, or by the User's error or omissions. 
MSU-IIT specifically denies any responsibility for the accuracy or quality 
of information obtained through MSU-IIT e-mail resources, except material 
represented as an official MSU-IIT record. Any views expressed in this 
e-mail are those of the individual sender and may not necessarily reflect 
the views of MSU-IIT, except where the message states otherwise and the 
sender is authorized to state them to be the views of MSU-IIT. The 
information contained in this e-mail, including those in its attachments, 
is confidential and intended only for the person(s) or entity(ies) to which 
it is addressed. If you are not an intended recipient, you must not read, 
copy, store, disclose, distribute this message, or act in reliance upon the 
information contained in it. If you received this e-mail in error, please 
contact the sender and delete the material from any computer or system.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5b767106-50e4-42fa-9156-b904921c4e8bn%40googlegroups.com.


Re: Road Map for a newbie

2023-08-18 Thread ASAMOAH EMMANUEL
do lots of projects and refer to the documentation when you need to
understand concepts in detail. Here is my private channel where I upload
django premium resources with ton of projects. here is the invite link if
you want to avoid the frustration of finding organized tutorials and hands
on to try. https://t.me/+VXTu7RXQ47VlM2Q0

On Fri, Aug 18, 2023 at 3:00 AM Sebastian Jung 
wrote:

> Hello,
>
> At the beginning i read much tutorials about function based django. It is
> on beginning a little bit easier because you understand how a list-,
> create-/update- and deleteview works. For little project this approach is
> fine. I waste with function based aproach too much time because i extend my
> own project after and after and then when for example i find a mistake in
> one listview most other listviewa from another models i must fix. So it is
> hugh amount of bugfixes.
>
> Then i learn class based approach this i a little bit harder because you
> don't know which classes exists and what of this classes what makes. It
> exists in Internet one website where you find perfectly what classes exists
> and much classes have comments what class does. Since i use class based
> views i am very happy.
>
> On beginning i have for every listview and for every form a own template.
> Also i find same problem like in function based approach... Often i want to
> extend all of listview Templates with same feature and then i fix muuuch
> templates. Then i build me self for list-, create-, updateview one template
> where i can insert every model. Since that i am very happy.
>
> I learn how i can make own widgets.
>
> I learn how i can makes my own filter/tags for templates.
>
> I disagree mike with his tip to take django documentation because this
> manual is very nice when you search for a specific thing. But for learning
> as beginner this is not right approach.
>
> I give you know my tip: learn short how you writes function based
> listview/deleteview/createview and updateview then when you know how it
> works don't waste time to go deeper in function based. Learn instant usage
> of classes based which class, method exists and what it makes and how you
> override this methods... there exists in internet much tutorials also in
> class based views
>
> When you know this writes me then i give you more tipps
>
> Last thing there exists a Webpage for django simple is better then
> complex. There you find much good tutorials veeery good describe and very
> usefull for example django and Ajax...
>
> Begin with your own project and extend it after and after and if yoz have
> questions then writes me...
>
> Good luck
>
> Mike Dewhirst  schrieb am Fr., 18. Aug. 2023,
> 02:24:
>
>> On 17/08/2023 7:24 pm, Tesfaye Yimam wrote:
>>
>> Hello all,
>>
>> This is my second day of learning Django. I am comfortable with python
>> (the basics and the OOP).
>> I wanted to have some guidance from this community to learn Djanog by
>> taking small steps in a consistent way.
>> Any one who has a road-map, especially if you tried it and worked for
>> you,  that will greatly help me in the learning process of Django. So,
>> please drop me a message here.
>> I'm happy to be here.
>>
>>
>> Welcome!
>>
>> There would be no better way to start than working through the tutorial
>> in the docs, step by step ...
>>
>> https://docs.djangoproject.com/en/4.2/
>>
>> Afterwards, you should decide/specify your own project and when the spec
>> is more or less settled you should set it up as a fresh project and make it
>> happen.
>>
>> The critical part of learning Django is the specification of what you
>> want. Personally, I keep the (excellent) docs permanently open in my
>> browser so I can research how to achieve what I want to happen.
>>
>> You will discover that Django takes a couple of different paths and you
>> need to choose. Both are valid but I chose functional views rather than
>> class-based views.
>>
>> My reasons were that functional views seem simpler and allowed me
>> absolute flexibility. I felt that class-based views while brilliant were
>> more difficult for me. YMMV.
>>
>> Also, Django now allows async programming. That's a bit too advanced for
>> me - at least until it becomes necessary.
>>
>> Good luck
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/e9724d36-e07b-42b2-8902-6a8294c695b5n%40googlegroups.com
>> 
>> .
>>
>>
>>
>> --
>> Signed email is an absolute defence against phishing. This email has
>> been signed with my private key. If you import my public key you can
>> automatically decrypt my signature and be sure it 

Re: Road Map for a newbie

2023-08-18 Thread Mike Dewhirst

On 18/08/2023 10:59 am, Sebastian Jung wrote:

Hello,

At the beginning i read much tutorials about function based django. It 
is on beginning a little bit easier because you understand how a 
list-, create-/update- and deleteview works. For little project this 
approach is fine. I waste with function based aproach too much time 
because i extend my own project after and after and then when for 
example i find a mistake in one listview most other listviewa from 
another models i must fix. So it is hugh amount of bugfixes.


Then i learn class based approach this i a little bit harder because 
you don't know which classes exists and what of this classes what 
makes. It exists in Internet one website where you find perfectly what 
classes exists and much classes have comments what class does. Since i 
use class based views i am very happy.


For a newbie, the learning curve should be as shallow as possible - "a 
little bit harder" might be too much.


BTW ... https://spookylukey.github.io/django-views-the-right-way/



On beginning i have for every listview and for every form a own 
template. Also i find same problem like in function based approach... 
Often i want to extend all of listview Templates with same feature and 
then i fix muuuch templates. Then i build me self for list-, create-, 
updateview one template where i can insert every model. Since that i 
am very happy.


I learn how i can make own widgets.

I learn how i can makes my own filter/tags for templates.

I disagree mike with his tip to take django documentation because this 
manual is very nice when you search for a specific thing. But for 
learning as beginner this is not right approach.


I give you know my tip: learn short how you writes function based 
listview/deleteview/createview and updateview then when you know how 
it works don't waste time to go deeper in function based. Learn 
instant usage of classes based which class, method exists and what it 
makes and how you override this methods... there exists in internet 
much tutorials also in class based views


When you know this writes me then i give you more tipps

Last thing there exists a Webpage for django simple is better then 
complex. There you find much good tutorials veeery good describe and 
very usefull for example django and Ajax...


Begin with your own project and extend it after and after and if yoz 
have questions then writes me...


Good luck

Mike Dewhirst  schrieb am Fr., 18. Aug. 2023, 
02:24:


On 17/08/2023 7:24 pm, Tesfaye Yimam wrote:

Hello all,

This is my second day of learning Django. I am comfortable with
python (the basics and the OOP).
I wanted to have some guidance from this community to learn
Djanog by taking small steps in a consistent way.
Any one who has a road-map, especially if you tried it and worked
for you,  that will greatly help me in the learning process of
Django. So, please drop me a message here.
I'm happy to be here.


Welcome!

There would be no better way to start than working through the
tutorial in the docs, step by step ...

https://docs.djangoproject.com/en/4.2/

Afterwards, you should decide/specify your own project and when
the spec is more or less settled you should set it up as a fresh
project and make it happen.

The critical part of learning Django is the specification of what
you want. Personally, I keep the (excellent) docs permanently open
in my browser so I can research how to achieve what I want to happen.

You will discover that Django takes a couple of different paths
and you need to choose. Both are valid but I chose functional
views rather than class-based views.

My reasons were that functional views seem simpler and allowed me
absolute flexibility. I felt that class-based views while
brilliant were more difficult for me. YMMV.

Also, Django now allows async programming. That's a bit too
advanced for me - at least until it becomes necessary.

Good luck



-- 
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 view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/e9724d36-e07b-42b2-8902-6a8294c695b5n%40googlegroups.com

<https://groups.google.com/d/msgid/django-users/e9724d36-e07b-42b2-8902-6a8294c695b5n%40googlegroups.com?utm_medium=email_source=footer>.



-- 
Signed email is an absolute defence against phishing. This email has

been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.

-- 
You received this message because you are subscribed to the Google

Groups "Django users&

Re: Road Map for a newbie

2023-08-17 Thread Sebastian Jung
Hello,

At the beginning i read much tutorials about function based django. It is
on beginning a little bit easier because you understand how a list-,
create-/update- and deleteview works. For little project this approach is
fine. I waste with function based aproach too much time because i extend my
own project after and after and then when for example i find a mistake in
one listview most other listviewa from another models i must fix. So it is
hugh amount of bugfixes.

Then i learn class based approach this i a little bit harder because you
don't know which classes exists and what of this classes what makes. It
exists in Internet one website where you find perfectly what classes exists
and much classes have comments what class does. Since i use class based
views i am very happy.

On beginning i have for every listview and for every form a own template.
Also i find same problem like in function based approach... Often i want to
extend all of listview Templates with same feature and then i fix muuuch
templates. Then i build me self for list-, create-, updateview one template
where i can insert every model. Since that i am very happy.

I learn how i can make own widgets.

I learn how i can makes my own filter/tags for templates.

I disagree mike with his tip to take django documentation because this
manual is very nice when you search for a specific thing. But for learning
as beginner this is not right approach.

I give you know my tip: learn short how you writes function based
listview/deleteview/createview and updateview then when you know how it
works don't waste time to go deeper in function based. Learn instant usage
of classes based which class, method exists and what it makes and how you
override this methods... there exists in internet much tutorials also in
class based views

When you know this writes me then i give you more tipps

Last thing there exists a Webpage for django simple is better then complex.
There you find much good tutorials veeery good describe and very usefull
for example django and Ajax...

Begin with your own project and extend it after and after and if yoz have
questions then writes me...

Good luck

Mike Dewhirst  schrieb am Fr., 18. Aug. 2023, 02:24:

> On 17/08/2023 7:24 pm, Tesfaye Yimam wrote:
>
> Hello all,
>
> This is my second day of learning Django. I am comfortable with python
> (the basics and the OOP).
> I wanted to have some guidance from this community to learn Djanog by
> taking small steps in a consistent way.
> Any one who has a road-map, especially if you tried it and worked for
> you,  that will greatly help me in the learning process of Django. So,
> please drop me a message here.
> I'm happy to be here.
>
>
> Welcome!
>
> There would be no better way to start than working through the tutorial in
> the docs, step by step ...
>
> https://docs.djangoproject.com/en/4.2/
>
> Afterwards, you should decide/specify your own project and when the spec
> is more or less settled you should set it up as a fresh project and make it
> happen.
>
> The critical part of learning Django is the specification of what you
> want. Personally, I keep the (excellent) docs permanently open in my
> browser so I can research how to achieve what I want to happen.
>
> You will discover that Django takes a couple of different paths and you
> need to choose. Both are valid but I chose functional views rather than
> class-based views.
>
> My reasons were that functional views seem simpler and allowed me absolute
> flexibility. I felt that class-based views while brilliant were more
> difficult for me. YMMV.
>
> Also, Django now allows async programming. That's a bit too advanced for
> me - at least until it becomes necessary.
>
> Good luck
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e9724d36-e07b-42b2-8902-6a8294c695b5n%40googlegroups.com
> 
> .
>
>
>
> --
> Signed email is an absolute defence against phishing. This email has
> been signed with my private key. If you import my public key you can
> automatically decrypt my signature and be sure it came from me. Your
> email software can handle signing.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ca6aa1dd-f7a0-702c-e317-f8998cda53a4%40dewhirst.com.au
> 

Re: Road Map for a newbie

2023-08-17 Thread Mike Dewhirst

On 17/08/2023 7:24 pm, Tesfaye Yimam wrote:

Hello all,

This is my second day of learning Django. I am comfortable with python 
(the basics and the OOP).
I wanted to have some guidance from this community to learn Djanog by 
taking small steps in a consistent way.
Any one who has a road-map, especially if you tried it and worked for 
you,  that will greatly help me in the learning process of Django. So, 
please drop me a message here.

I'm happy to be here.


Welcome!

There would be no better way to start than working through the tutorial 
in the docs, step by step ...


https://docs.djangoproject.com/en/4.2/

Afterwards, you should decide/specify your own project and when the spec 
is more or less settled you should set it up as a fresh project and make 
it happen.


The critical part of learning Django is the specification of what you 
want. Personally, I keep the (excellent) docs permanently open in my 
browser so I can research how to achieve what I want to happen.


You will discover that Django takes a couple of different paths and you 
need to choose. Both are valid but I chose functional views rather than 
class-based views.


My reasons were that functional views seem simpler and allowed me 
absolute flexibility. I felt that class-based views while brilliant were 
more difficult for me. YMMV.


Also, Django now allows async programming. That's a bit too advanced for 
me - at least until it becomes necessary.


Good luck



--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e9724d36-e07b-42b2-8902-6a8294c695b5n%40googlegroups.com 
.



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ca6aa1dd-f7a0-702c-e317-f8998cda53a4%40dewhirst.com.au.


OpenPGP_signature
Description: OpenPGP digital signature


Re: Road Map for a newbie

2023-08-17 Thread ivan harold
try learning by going to certain websites that offer to learn, such as 
w3schools.com . 

On Thursday, August 17, 2023 at 10:15:03 AM UTC-5 Tesfaye Yimam wrote:

> Hello all,
>
> This is my second day of learning Django. I am comfortable with python 
> (the basics and the OOP).
> I wanted to have some guidance from this community to learn Djanog by 
> taking small steps in a consistent way. 
> Any one who has a road-map, especially if you tried it and worked for 
> you,  that will greatly help me in the learning process of Django. So, 
> please drop me a message here. 
> I'm happy to be here.
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c0012d78-357a-4135-81e4-e42fd8a207f7n%40googlegroups.com.


Road Map for a newbie

2023-08-17 Thread Tesfaye Yimam
Hello all,

This is my second day of learning Django. I am comfortable with python (the 
basics and the OOP).
I wanted to have some guidance from this community to learn Djanog by 
taking small steps in a consistent way. 
Any one who has a road-map, especially if you tried it and worked for you,  
that will greatly help me in the learning process of Django. So, please 
drop me a message here. 
I'm happy to be here.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e9724d36-e07b-42b2-8902-6a8294c695b5n%40googlegroups.com.


Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread 'Bob Aalsma' via Django users
Hmm, when I remove the raise CommandError statement and replace it with 
self.stdout.write, everything works well.

This helps me to point further studies. Thx!
On Wednesday, May 10, 2023 at 2:33:18 PM UTC+2 Bob Aalsma wrote:

> Ah, yes, thanks.
>
> I hesitate to comment on "If I understood the error right." ;)
>
> Umm, my problem here is that I think I'm using the exact same *code* 
> "manually" without errors. 
> I think I'm also using the same *values* for the manual and test runs.
> So I don't understand the reason for the differences in output.
>
> On Wednesday, May 10, 2023 at 2:18:33 PM UTC+2 Vishesh Mangla wrote:
>
>> If I understood the error right.
>>
>> On Wed, May 10, 2023 at 5:47 PM Vishesh Mangla  
>> wrote:
>>
>>> Probably this would help: 
>>> https://stackoverflow.com/questions/8609192/what-is-the-difference-between-null-true-and-blank-true-in-django
>>>
>>> On Wed, May 10, 2023 at 5:45 PM 'Bob Aalsma' via Django users <
>>> django...@googlegroups.com> wrote:
>>>
 Sorry Vishesh, thanks for the quick answer but I have no idea what you 
 mean.

 On Wednesday, May 10, 2023 at 2:00:51 PM UTC+2 Vishesh Mangla wrote:

> False or True check for yourself.
>
> On Wed, 10 May, 2023, 17:29 Vishesh Mangla,  
> wrote:
>
>> It looks like you are passing a null but null=False is not set
>>
>> On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
>> django...@googlegroups.com> wrote:
>>
>>> I'm trying to test a django-admin command and don't understand why 
>>> the tests give errors on the code while the code works as expected.
>>>
>>> I'm under the impression that the *raise CommandError* is ignored 
>>> by the test, but don't understand why this would be.
>>>
>>> Please help.
>>>
>>> Running the code shows:
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>> populate_source 0
>>>
>>> *CommandError: Alleen hele getallen > 0 toegestaan*
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>> populate_source 1
>>>
>>> *Teksten zijn gegenereerd voor tekstlengte 1*
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>> populate_source 1
>>>
>>> *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>> populate_source 7
>>>
>>> *CommandError: Opgegeven sleutel 7 niet gevonden*
>>>
>>> Running the tests shows
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>> test tests.test_sources_app_command_populate
>>>
>>> Found 3 test(s).
>>>
>>> Creating test database for alias 'default'...
>>>
>>> System check identified no issues (0 silenced).
>>>
>>> EEE
>>>
>>>
>>> ==
>>>
>>> ERROR: test_command_output_been_there 
>>> (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)
>>>
>>> Test for failure: in_use = True.
>>>
>>>
>>> --
>>>
>>> Traceback (most recent call last):
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
>>>  
>>> line 89, in _execute
>>>
>>> return self.cursor.execute(sql, params)
>>>
>>>
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
>>>  
>>> line 328, in execute
>>>
>>> return super().execute(query, params)
>>>
>>>^^
>>>
>>> sqlite3.IntegrityError: NOT NULL constraint failed: 
>>> domain_sources_app_characternumber.number_of_combinations
>>>
>>>
>>> The above exception was the direct cause of the following exception:
>>>
>>>
>>> Traceback (most recent call last):
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/tests/test_sources_app_command_populate.py",
>>>  
>>> line 30, in test_command_output_been_there
>>>
>>> thingy.save()
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>>  
>>> line 814, in save
>>>
>>> self.save_base(
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>>  
>>> line 877, in save_base
>>>
>>> updated = self._save_table(
>>>
>>>   ^
>>>
>>>   File 
>>> 

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread 'Bob Aalsma' via Django users
Ah, yes, thanks.

I hesitate to comment on "If I understood the error right." ;)

Umm, my problem here is that I think I'm using the exact same *code* 
"manually" without errors. 
I think I'm also using the same *values* for the manual and test runs.
So I don't understand the reason for the differences in output.

On Wednesday, May 10, 2023 at 2:18:33 PM UTC+2 Vishesh Mangla wrote:

> If I understood the error right.
>
> On Wed, May 10, 2023 at 5:47 PM Vishesh Mangla  
> wrote:
>
>> Probably this would help: 
>> https://stackoverflow.com/questions/8609192/what-is-the-difference-between-null-true-and-blank-true-in-django
>>
>> On Wed, May 10, 2023 at 5:45 PM 'Bob Aalsma' via Django users <
>> django...@googlegroups.com> wrote:
>>
>>> Sorry Vishesh, thanks for the quick answer but I have no idea what you 
>>> mean.
>>>
>>> On Wednesday, May 10, 2023 at 2:00:51 PM UTC+2 Vishesh Mangla wrote:
>>>
 False or True check for yourself.

 On Wed, 10 May, 2023, 17:29 Vishesh Mangla,  
 wrote:

> It looks like you are passing a null but null=False is not set
>
> On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
> django...@googlegroups.com> wrote:
>
>> I'm trying to test a django-admin command and don't understand why 
>> the tests give errors on the code while the code works as expected.
>>
>> I'm under the impression that the *raise CommandError* is ignored by 
>> the test, but don't understand why this would be.
>>
>> Please help.
>>
>> Running the code shows:
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>> populate_source 0
>>
>> *CommandError: Alleen hele getallen > 0 toegestaan*
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>> populate_source 1
>>
>> *Teksten zijn gegenereerd voor tekstlengte 1*
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>> populate_source 1
>>
>> *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>> populate_source 7
>>
>> *CommandError: Opgegeven sleutel 7 niet gevonden*
>>
>> Running the tests shows
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>> test tests.test_sources_app_command_populate
>>
>> Found 3 test(s).
>>
>> Creating test database for alias 'default'...
>>
>> System check identified no issues (0 silenced).
>>
>> EEE
>>
>> ==
>>
>> ERROR: test_command_output_been_there 
>> (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)
>>
>> Test for failure: in_use = True.
>>
>> --
>>
>> Traceback (most recent call last):
>>
>>   File 
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
>>  
>> line 89, in _execute
>>
>> return self.cursor.execute(sql, params)
>>
>>
>>
>>   File 
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
>>  
>> line 328, in execute
>>
>> return super().execute(query, params)
>>
>>^^
>>
>> sqlite3.IntegrityError: NOT NULL constraint failed: 
>> domain_sources_app_characternumber.number_of_combinations
>>
>>
>> The above exception was the direct cause of the following exception:
>>
>>
>> Traceback (most recent call last):
>>
>>   File 
>> "/Users/werker/Projects/domain_reader/tests/test_sources_app_command_populate.py",
>>  
>> line 30, in test_command_output_been_there
>>
>> thingy.save()
>>
>>   File 
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>  
>> line 814, in save
>>
>> self.save_base(
>>
>>   File 
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>  
>> line 877, in save_base
>>
>> updated = self._save_table(
>>
>>   ^
>>
>>   File 
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>  
>> line 1020, in _save_table
>>
>> results = self._do_insert(
>>
>>   
>>
>>   File 
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>  
>> line 1061, in _do_insert
>>
>> return 

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread Vishesh Mangla
If I understood the error right.

On Wed, May 10, 2023 at 5:47 PM Vishesh Mangla 
wrote:

> Probably this would help:
> https://stackoverflow.com/questions/8609192/what-is-the-difference-between-null-true-and-blank-true-in-django
>
> On Wed, May 10, 2023 at 5:45 PM 'Bob Aalsma' via Django users <
> django-users@googlegroups.com> wrote:
>
>> Sorry Vishesh, thanks for the quick answer but I have no idea what you
>> mean.
>>
>> On Wednesday, May 10, 2023 at 2:00:51 PM UTC+2 Vishesh Mangla wrote:
>>
>>> False or True check for yourself.
>>>
>>> On Wed, 10 May, 2023, 17:29 Vishesh Mangla, 
>>> wrote:
>>>
 It looks like you are passing a null but null=False is not set

 On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
 django...@googlegroups.com> wrote:

> I'm trying to test a django-admin command and don't understand why the
> tests give errors on the code while the code works as expected.
>
> I'm under the impression that the *raise CommandError* is ignored by
> the test, but don't understand why this would be.
>
> Please help.
>
> Running the code shows:
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
> populate_source 0
>
> *CommandError: Alleen hele getallen > 0 toegestaan*
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
> populate_source 1
>
> *Teksten zijn gegenereerd voor tekstlengte 1*
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
> populate_source 1
>
> *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
> populate_source 7
>
> *CommandError: Opgegeven sleutel 7 niet gevonden*
>
> Running the tests shows
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
> test tests.test_sources_app_command_populate
>
> Found 3 test(s).
>
> Creating test database for alias 'default'...
>
> System check identified no issues (0 silenced).
>
> EEE
>
> ==
>
> ERROR: test_command_output_been_there
> (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)
>
> Test for failure: in_use = True.
>
> --
>
> Traceback (most recent call last):
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
> line 89, in _execute
>
> return self.cursor.execute(sql, params)
>
>
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
> line 328, in execute
>
> return super().execute(query, params)
>
>^^
>
> sqlite3.IntegrityError: NOT NULL constraint failed:
> domain_sources_app_characternumber.number_of_combinations
>
>
> The above exception was the direct cause of the following exception:
>
>
> Traceback (most recent call last):
>
>   File
> "/Users/werker/Projects/domain_reader/tests/test_sources_app_command_populate.py",
> line 30, in test_command_output_been_there
>
> thingy.save()
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
> line 814, in save
>
> self.save_base(
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
> line 877, in save_base
>
> updated = self._save_table(
>
>   ^
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
> line 1020, in _save_table
>
> results = self._do_insert(
>
>   
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
> line 1061, in _do_insert
>
> return manager._insert(
>
>
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/manager.py",
> line 87, in manager_method
>
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>
>^^^
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/query.py",
> line 1805, in _insert
>
> return
> query.get_compiler(using=using).execute_sql(returning_fields)
>

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread Vishesh Mangla
Probably this would help:
https://stackoverflow.com/questions/8609192/what-is-the-difference-between-null-true-and-blank-true-in-django

On Wed, May 10, 2023 at 5:45 PM 'Bob Aalsma' via Django users <
django-users@googlegroups.com> wrote:

> Sorry Vishesh, thanks for the quick answer but I have no idea what you
> mean.
>
> On Wednesday, May 10, 2023 at 2:00:51 PM UTC+2 Vishesh Mangla wrote:
>
>> False or True check for yourself.
>>
>> On Wed, 10 May, 2023, 17:29 Vishesh Mangla,  wrote:
>>
>>> It looks like you are passing a null but null=False is not set
>>>
>>> On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
>>> django...@googlegroups.com> wrote:
>>>
 I'm trying to test a django-admin command and don't understand why the
 tests give errors on the code while the code works as expected.

 I'm under the impression that the *raise CommandError* is ignored by
 the test, but don't understand why this would be.

 Please help.

 Running the code shows:

 (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
 populate_source 0

 *CommandError: Alleen hele getallen > 0 toegestaan*

 (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
 populate_source 1

 *Teksten zijn gegenereerd voor tekstlengte 1*

 (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
 populate_source 1

 *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*

 (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
 populate_source 7

 *CommandError: Opgegeven sleutel 7 niet gevonden*

 Running the tests shows

 (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py test
 tests.test_sources_app_command_populate

 Found 3 test(s).

 Creating test database for alias 'default'...

 System check identified no issues (0 silenced).

 EEE

 ==

 ERROR: test_command_output_been_there
 (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)

 Test for failure: in_use = True.

 --

 Traceback (most recent call last):

   File
 "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
 line 89, in _execute

 return self.cursor.execute(sql, params)



   File
 "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
 line 328, in execute

 return super().execute(query, params)

^^

 sqlite3.IntegrityError: NOT NULL constraint failed:
 domain_sources_app_characternumber.number_of_combinations


 The above exception was the direct cause of the following exception:


 Traceback (most recent call last):

   File
 "/Users/werker/Projects/domain_reader/tests/test_sources_app_command_populate.py",
 line 30, in test_command_output_been_there

 thingy.save()

   File
 "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
 line 814, in save

 self.save_base(

   File
 "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
 line 877, in save_base

 updated = self._save_table(

   ^

   File
 "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
 line 1020, in _save_table

 results = self._do_insert(

   

   File
 "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
 line 1061, in _do_insert

 return manager._insert(



   File
 "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/manager.py",
 line 87, in manager_method

 return getattr(self.get_queryset(), name)(*args, **kwargs)

^^^

   File
 "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/query.py",
 line 1805, in _insert

 return query.get_compiler(using=using).execute_sql(returning_fields)

^

   File
 "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/sql/compiler.py",
 line 1820, in execute_sql

 

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread 'Bob Aalsma' via Django users
Sorry Vishesh, thanks for the quick answer but I have no idea what you mean.

On Wednesday, May 10, 2023 at 2:00:51 PM UTC+2 Vishesh Mangla wrote:

> False or True check for yourself.
>
> On Wed, 10 May, 2023, 17:29 Vishesh Mangla,  wrote:
>
>> It looks like you are passing a null but null=False is not set
>>
>> On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
>> django...@googlegroups.com> wrote:
>>
>>> I'm trying to test a django-admin command and don't understand why the 
>>> tests give errors on the code while the code works as expected.
>>>
>>> I'm under the impression that the *raise CommandError* is ignored by 
>>> the test, but don't understand why this would be.
>>>
>>> Please help.
>>>
>>> Running the code shows:
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>> populate_source 0
>>>
>>> *CommandError: Alleen hele getallen > 0 toegestaan*
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>> populate_source 1
>>>
>>> *Teksten zijn gegenereerd voor tekstlengte 1*
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>> populate_source 1
>>>
>>> *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>> populate_source 7
>>>
>>> *CommandError: Opgegeven sleutel 7 niet gevonden*
>>>
>>> Running the tests shows
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py test 
>>> tests.test_sources_app_command_populate
>>>
>>> Found 3 test(s).
>>>
>>> Creating test database for alias 'default'...
>>>
>>> System check identified no issues (0 silenced).
>>>
>>> EEE
>>>
>>> ==
>>>
>>> ERROR: test_command_output_been_there 
>>> (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)
>>>
>>> Test for failure: in_use = True.
>>>
>>> --
>>>
>>> Traceback (most recent call last):
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
>>>  
>>> line 89, in _execute
>>>
>>> return self.cursor.execute(sql, params)
>>>
>>>
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
>>>  
>>> line 328, in execute
>>>
>>> return super().execute(query, params)
>>>
>>>^^
>>>
>>> sqlite3.IntegrityError: NOT NULL constraint failed: 
>>> domain_sources_app_characternumber.number_of_combinations
>>>
>>>
>>> The above exception was the direct cause of the following exception:
>>>
>>>
>>> Traceback (most recent call last):
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/tests/test_sources_app_command_populate.py",
>>>  
>>> line 30, in test_command_output_been_there
>>>
>>> thingy.save()
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>>  
>>> line 814, in save
>>>
>>> self.save_base(
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>>  
>>> line 877, in save_base
>>>
>>> updated = self._save_table(
>>>
>>>   ^
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>>  
>>> line 1020, in _save_table
>>>
>>> results = self._do_insert(
>>>
>>>   
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>>  
>>> line 1061, in _do_insert
>>>
>>> return manager._insert(
>>>
>>>
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/manager.py",
>>>  
>>> line 87, in manager_method
>>>
>>> return getattr(self.get_queryset(), name)(*args, **kwargs)
>>>
>>>^^^
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/query.py",
>>>  
>>> line 1805, in _insert
>>>
>>> return query.get_compiler(using=using).execute_sql(returning_fields)
>>>
>>>^
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/sql/compiler.py",
>>>  
>>> line 1820, in execute_sql
>>>
>>> cursor.execute(sql, params)
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
>>>  
>>> line 67, in execute
>>>
>>> return self._execute_with_wrappers(
>>>
>>>
>>>
>>>   File 
>>> 

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread Vishesh Mangla
False or True check for yourself.

On Wed, 10 May, 2023, 17:29 Vishesh Mangla, 
wrote:

> It looks like you are passing a null but null=False is not set
>
> On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
> django-users@googlegroups.com> wrote:
>
>> I'm trying to test a django-admin command and don't understand why the
>> tests give errors on the code while the code works as expected.
>>
>> I'm under the impression that the *raise CommandError* is ignored by the
>> test, but don't understand why this would be.
>>
>> Please help.
>>
>> Running the code shows:
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>> populate_source 0
>>
>> *CommandError: Alleen hele getallen > 0 toegestaan*
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>> populate_source 1
>>
>> *Teksten zijn gegenereerd voor tekstlengte 1*
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>> populate_source 1
>>
>> *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
>> populate_source 7
>>
>> *CommandError: Opgegeven sleutel 7 niet gevonden*
>>
>> Running the tests shows
>>
>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py test
>> tests.test_sources_app_command_populate
>>
>> Found 3 test(s).
>>
>> Creating test database for alias 'default'...
>>
>> System check identified no issues (0 silenced).
>>
>> EEE
>>
>> ==
>>
>> ERROR: test_command_output_been_there
>> (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)
>>
>> Test for failure: in_use = True.
>>
>> --
>>
>> Traceback (most recent call last):
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
>> line 89, in _execute
>>
>> return self.cursor.execute(sql, params)
>>
>>
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
>> line 328, in execute
>>
>> return super().execute(query, params)
>>
>>^^
>>
>> sqlite3.IntegrityError: NOT NULL constraint failed:
>> domain_sources_app_characternumber.number_of_combinations
>>
>>
>> The above exception was the direct cause of the following exception:
>>
>>
>> Traceback (most recent call last):
>>
>>   File
>> "/Users/werker/Projects/domain_reader/tests/test_sources_app_command_populate.py",
>> line 30, in test_command_output_been_there
>>
>> thingy.save()
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>> line 814, in save
>>
>> self.save_base(
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>> line 877, in save_base
>>
>> updated = self._save_table(
>>
>>   ^
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>> line 1020, in _save_table
>>
>> results = self._do_insert(
>>
>>   
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>> line 1061, in _do_insert
>>
>> return manager._insert(
>>
>>
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/manager.py",
>> line 87, in manager_method
>>
>> return getattr(self.get_queryset(), name)(*args, **kwargs)
>>
>>^^^
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/query.py",
>> line 1805, in _insert
>>
>> return query.get_compiler(using=using).execute_sql(returning_fields)
>>
>>^
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/sql/compiler.py",
>> line 1820, in execute_sql
>>
>> cursor.execute(sql, params)
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
>> line 67, in execute
>>
>> return self._execute_with_wrappers(
>>
>>
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
>> line 80, in _execute_with_wrappers
>>
>> return executor(sql, params, many, context)
>>
>>
>>
>>   File
>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
>> line 84, in _execute
>>
>> with 

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread Vishesh Mangla
It looks like you are passing a null but null=False is not set

On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
django-users@googlegroups.com> wrote:

> I'm trying to test a django-admin command and don't understand why the
> tests give errors on the code while the code works as expected.
>
> I'm under the impression that the *raise CommandError* is ignored by the
> test, but don't understand why this would be.
>
> Please help.
>
> Running the code shows:
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
> populate_source 0
>
> *CommandError: Alleen hele getallen > 0 toegestaan*
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
> populate_source 1
>
> *Teksten zijn gegenereerd voor tekstlengte 1*
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
> populate_source 1
>
> *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py
> populate_source 7
>
> *CommandError: Opgegeven sleutel 7 niet gevonden*
>
> Running the tests shows
>
> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py test
> tests.test_sources_app_command_populate
>
> Found 3 test(s).
>
> Creating test database for alias 'default'...
>
> System check identified no issues (0 silenced).
>
> EEE
>
> ==
>
> ERROR: test_command_output_been_there
> (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)
>
> Test for failure: in_use = True.
>
> --
>
> Traceback (most recent call last):
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
> line 89, in _execute
>
> return self.cursor.execute(sql, params)
>
>
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
> line 328, in execute
>
> return super().execute(query, params)
>
>^^
>
> sqlite3.IntegrityError: NOT NULL constraint failed:
> domain_sources_app_characternumber.number_of_combinations
>
>
> The above exception was the direct cause of the following exception:
>
>
> Traceback (most recent call last):
>
>   File
> "/Users/werker/Projects/domain_reader/tests/test_sources_app_command_populate.py",
> line 30, in test_command_output_been_there
>
> thingy.save()
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
> line 814, in save
>
> self.save_base(
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
> line 877, in save_base
>
> updated = self._save_table(
>
>   ^
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
> line 1020, in _save_table
>
> results = self._do_insert(
>
>   
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
> line 1061, in _do_insert
>
> return manager._insert(
>
>
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/manager.py",
> line 87, in manager_method
>
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>
>^^^
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/query.py",
> line 1805, in _insert
>
> return query.get_compiler(using=using).execute_sql(returning_fields)
>
>^
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/sql/compiler.py",
> line 1820, in execute_sql
>
> cursor.execute(sql, params)
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
> line 67, in execute
>
> return self._execute_with_wrappers(
>
>
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
> line 80, in _execute_with_wrappers
>
> return executor(sql, params, many, context)
>
>
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
> line 84, in _execute
>
> with self.db.wrap_database_errors:
>
>   File
> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/utils.py",
> line 91, in __exit__
>
> raise dj_exc_value.with_traceback(traceback) from exc_value
>
>   File
> 

testing newbie - help requested: app works, tests give errors

2023-05-10 Thread 'Bob Aalsma' via Django users
I'm trying to test a django-admin command and don't understand why the 
tests give errors on the code while the code works as expected.

I'm under the impression that the *raise CommandError* is ignored by the 
test, but don't understand why this would be.

Please help.

Running the code shows:

(.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
populate_source 0

*CommandError: Alleen hele getallen > 0 toegestaan*

(.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
populate_source 1

*Teksten zijn gegenereerd voor tekstlengte 1*

(.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
populate_source 1

*CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*

(.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
populate_source 7

*CommandError: Opgegeven sleutel 7 niet gevonden*

Running the tests shows

(.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py test 
tests.test_sources_app_command_populate

Found 3 test(s).

Creating test database for alias 'default'...

System check identified no issues (0 silenced).

EEE

==

ERROR: test_command_output_been_there 
(tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)

Test for failure: in_use = True.

--

Traceback (most recent call last):

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
 
line 89, in _execute

return self.cursor.execute(sql, params)

   

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
 
line 328, in execute

return super().execute(query, params)

   ^^

sqlite3.IntegrityError: NOT NULL constraint failed: 
domain_sources_app_characternumber.number_of_combinations


The above exception was the direct cause of the following exception:


Traceback (most recent call last):

  File 
"/Users/werker/Projects/domain_reader/tests/test_sources_app_command_populate.py",
 
line 30, in test_command_output_been_there

thingy.save()

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
 
line 814, in save

self.save_base(

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
 
line 877, in save_base

updated = self._save_table(

  ^

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
 
line 1020, in _save_table

results = self._do_insert(

  

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
 
line 1061, in _do_insert

return manager._insert(

   

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/manager.py",
 
line 87, in manager_method

return getattr(self.get_queryset(), name)(*args, **kwargs)

   ^^^

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/query.py",
 
line 1805, in _insert

return query.get_compiler(using=using).execute_sql(returning_fields)

   ^

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/sql/compiler.py",
 
line 1820, in execute_sql

cursor.execute(sql, params)

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
 
line 67, in execute

return self._execute_with_wrappers(

   

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
 
line 80, in _execute_with_wrappers

return executor(sql, params, many, context)

   

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
 
line 84, in _execute

with self.db.wrap_database_errors:

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/utils.py",
 
line 91, in __exit__

raise dj_exc_value.with_traceback(traceback) from exc_value

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
 
line 89, in _execute

return self.cursor.execute(sql, params)

   

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
 
line 328, in execute

return super().execute(query, 

Re: tech newbie

2022-09-28 Thread ASAMOAH EMMANUEL
Ok, I'll help you. Email me privately.

On Tue, Sep 27, 2022 at 2:40 PM Edward Deus Misogoro 
wrote:

> Ok, your welcome.
>
> On Mon, 26 Sept 2022, 23:43 Jay Jay,  wrote:
>
>> Hello bro, I hope you’re doing well? I’m a Jerry, a newbie in software
>> development, I have basic knowledge in HTML, CSS, JavaScript and python and
>> I really need a mentor who can help me through, so I can be very skill at
>> it. I’ll love if you can be my mentor, I would really appreciate it. Thank
>> you.
>>
>> On Mon, Sep 26, 2022 at 12:53 PM Abdulfarid Olakunle <
>> faridosk...@gmail.com> wrote:
>>
>>> Hello fellow developers, I will be creating a WhatsApp group chat later
>>> in the day, So I will like my fellow Python Django Developers to join the
>>> group. It will be much easier to discuss there and I will sacrifice myself
>>> out for anyone who need my service.
>>>
>>> God bless you all
>>> Enjoy your day
>>> Biliaminu
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CA%2BccuR0goa8Mu9MqNLyZtCAJedHKpVZ6pFfrpXKFJdjaRrgttQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CA%2BccuR0goa8Mu9MqNLyZtCAJedHKpVZ6pFfrpXKFJdjaRrgttQ%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAK4FT-qJQ6G7vtF-d9ViCP-VR9%2BnFJRycERJzMvcENq01XDgog%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAK4FT-qJQ6G7vtF-d9ViCP-VR9%2BnFJRycERJzMvcENq01XDgog%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAESqNWiA%2B5OoYo%2BinUUyfoduzVcjkqOJuUkX%3DU4nH6NkhpCypg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAESqNWiA%2B5OoYo%2BinUUyfoduzVcjkqOJuUkX%3DU4nH6NkhpCypg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABFHQYyJcb_ghduZbk_dYSy7cuMQ6s%3D2BBztj0r%2Bpvo0dz0x5A%40mail.gmail.com.


Re: tech newbie

2022-09-27 Thread Edward Deus Misogoro
Ok, your welcome.

On Mon, 26 Sept 2022, 23:43 Jay Jay,  wrote:

> Hello bro, I hope you’re doing well? I’m a Jerry, a newbie in software
> development, I have basic knowledge in HTML, CSS, JavaScript and python and
> I really need a mentor who can help me through, so I can be very skill at
> it. I’ll love if you can be my mentor, I would really appreciate it. Thank
> you.
>
> On Mon, Sep 26, 2022 at 12:53 PM Abdulfarid Olakunle <
> faridosk...@gmail.com> wrote:
>
>> Hello fellow developers, I will be creating a WhatsApp group chat later
>> in the day, So I will like my fellow Python Django Developers to join the
>> group. It will be much easier to discuss there and I will sacrifice myself
>> out for anyone who need my service.
>>
>> God bless you all
>> Enjoy your day
>> Biliaminu
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CA%2BccuR0goa8Mu9MqNLyZtCAJedHKpVZ6pFfrpXKFJdjaRrgttQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CA%2BccuR0goa8Mu9MqNLyZtCAJedHKpVZ6pFfrpXKFJdjaRrgttQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK4FT-qJQ6G7vtF-d9ViCP-VR9%2BnFJRycERJzMvcENq01XDgog%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK4FT-qJQ6G7vtF-d9ViCP-VR9%2BnFJRycERJzMvcENq01XDgog%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAESqNWiA%2B5OoYo%2BinUUyfoduzVcjkqOJuUkX%3DU4nH6NkhpCypg%40mail.gmail.com.


Re: tech newbie

2022-09-26 Thread Jay Jay
Hello bro, I hope you’re doing well? I’m a Jerry, a newbie in software
development, I have basic knowledge in HTML, CSS, JavaScript and python and
I really need a mentor who can help me through, so I can be very skill at
it. I’ll love if you can be my mentor, I would really appreciate it. Thank
you.

On Mon, Sep 26, 2022 at 12:53 PM Abdulfarid Olakunle 
wrote:

> Hello fellow developers, I will be creating a WhatsApp group chat later in
> the day, So I will like my fellow Python Django Developers to join the
> group. It will be much easier to discuss there and I will sacrifice myself
> out for anyone who need my service.
>
> God bless you all
> Enjoy your day
> Biliaminu
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2BccuR0goa8Mu9MqNLyZtCAJedHKpVZ6pFfrpXKFJdjaRrgttQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CA%2BccuR0goa8Mu9MqNLyZtCAJedHKpVZ6pFfrpXKFJdjaRrgttQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4FT-qJQ6G7vtF-d9ViCP-VR9%2BnFJRycERJzMvcENq01XDgog%40mail.gmail.com.


Re: newbie

2022-01-28 Thread machine learning
very academy had helped me a lot. I think this will be beneficial for you
also.

On Fri 28 Jan, 2022, 9:04 PM muwaga micheal,  wrote:

> Django is a good framework to learn. Its easy and has a great community to
> help.
> There are good videos on YouTube.
>
> On Thursday, January 27, 2022 at 5:10:56 PM UTC+3 jmizpaha...@gmail.com
> wrote:
>
>> It's easy if you get the Python basics first.
>> Suggest having a good grasp of Python basic concepts then you jump to
>> learning Django.
>> There's a lot of things Django can offer, you just need to understand
>> them before to jump to other topics :)
>>
>> On Thursday, 27 January 2022 at 22:02:42 UTC+8 me.ve...@gmail.com wrote:
>>
>>> hi all. is it easy to learn django...?
>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7d4a3c85-7aab-4b22-a9a7-60f0f76d19f8n%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKKYCB74hH4WS0DBHWSwHNsJ7SYCdkbwGLmx%2B-_V_K_DNCtOcw%40mail.gmail.com.


Re: newbie

2022-01-28 Thread muwaga micheal
Django is a good framework to learn. Its easy and has a great community to 
help.
There are good videos on YouTube. 

On Thursday, January 27, 2022 at 5:10:56 PM UTC+3 jmizpaha...@gmail.com 
wrote:

> It's easy if you get the Python basics first. 
> Suggest having a good grasp of Python basic concepts then you jump to 
> learning Django. 
> There's a lot of things Django can offer, you just need to understand them 
> before to jump to other topics :)  
>
> On Thursday, 27 January 2022 at 22:02:42 UTC+8 me.ve...@gmail.com wrote:
>
>> hi all. is it easy to learn django...?
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7d4a3c85-7aab-4b22-a9a7-60f0f76d19f8n%40googlegroups.com.


Re: newbie

2022-01-27 Thread John Dollosa
It's easy if you get the Python basics first. 
Suggest having a good grasp of Python basic concepts then you jump to 
learning Django. 
There's a lot of things Django can offer, you just need to understand them 
before to jump to other topics :)  

On Thursday, 27 January 2022 at 22:02:42 UTC+8 me.ve...@gmail.com wrote:

> hi all. is it easy to learn django...?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d752bb8a-1e0a-4d3c-8dcd-1bc71ed098c9n%40googlegroups.com.


newbie

2022-01-27 Thread Mico V.
hi all. is it easy to learn django...?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5ace22b0-c53f-4577-9268-1b6e4eeda429n%40googlegroups.com.


Re: Newbie of django

2021-12-13 Thread Marmik Patel
Pycharm is a good option if you want to login to your VPS by ssh, but still 
it is in beta mode.
When it comes to deploy the django site, it's little bit tricky.

You can use external proxy parser like gunicorn or uWSGI and use them with 
Apache or nginx.

Marmik

On Monday, 13 December 2021 at 19:00:50 UTC+5:30 keit...@gmail.com wrote:

> I want to start a project by using Django. I originally make use of 
> hosting service for my project. When I setup the django, it seems some 
> installation errors.
>
> Are there any simple setup procedures for hosting services? I can use SSH 
> to login the hosting server. Also, are there any good python editor which 
> can remotely connect the hosting server? Please give me advice. Thank you.
>
> Keith
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23e5e57a-a3c2-4477-b087-2fca067f3b09n%40googlegroups.com.


Newbie of django

2021-12-13 Thread Keith Hui
I want to start a project by using Django. I originally make use of hosting 
service for my project. When I setup the django, it seems some installation 
errors.

Are there any simple setup procedures for hosting services? I can use SSH 
to login the hosting server. Also, are there any good python editor which 
can remotely connect the hosting server? Please give me advice. Thank you.

Keith

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/eca09a1d-d827-4c4e-8f47-4c16fa6d856dn%40googlegroups.com.


Re: Newbie question

2021-06-07 Thread Lalit Suthar
try form.save(commit=False)


On Mon, 7 Jun 2021 at 22:10, Moose Smith <47kanga...@gmail.com> wrote:

> I have a table which holds simple data like addresses. Created a form
> which displays the records in the form and allows the user to select a
> record "address" to edit.
>
> I want this edit function to be generic so it will work on any table
> without me having to define fields etc... and using  ModelForm I
> accomplished by goal.
>
> Django creates a form and using instance='myrecord' it even populated the
> fields in the form with the record I want to edit. I can edit my fields
> and now it is time to save the changes back to the database.
>
> I found a .save() method for
> # Create a form to edit an existing Article, but use
> # POST data to populate the form.
> >>> a = Article.objects.get(pk=1)
> >>> f = ArticleForm(request.POST, instance=a) >>> f.save()
>
> My question is this:
> The .save method discuss in the Django Documentation above is a method of
> ModelForm but I have rendered my form and when I hit the SUBMIT button the
> edited fields are returned in a WSGI type object which does not have a save
> method.
>
> I can use the POST data and pass the PK and so on, and update the record
> manually with some code. BUT WHAT is the use of a .SAVE method on a
> ModelForm. In order to edit the form I need to RENDER it right?
>
> Is there a way to return the ModelForm object with the edited fields and
> then save back to the database?
>
> Thanks
>
> Moose
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6ccb9692-5f95-4f8a-86b1-18259b00c0dan%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGp2JVH-Da2AeUFzoXWsdPUQrg5%3Dg2ch8pToeA%2BSsdNNYSC4hQ%40mail.gmail.com.


Newbie question

2021-06-07 Thread Moose Smith
I have a table which holds simple data like addresses. Created a form which 
displays the records in the form and allows the user to select a record 
"address" to edit. 

I want this edit function to be generic so it will work on any table 
without me having to define fields etc... and using  ModelForm I 
accomplished by goal. 

Django creates a form and using instance='myrecord' it even populated the 
fields in the form with the record I want to edit. I can edit my fields  
and now it is time to save the changes back to the database.

I found a .save() method for 
# Create a form to edit an existing Article, but use
# POST data to populate the form.
>>> a = Article.objects.get(pk=1)
>>> f = ArticleForm(request.POST, instance=a) >>> f.save()

My question is this:
The .save method discuss in the Django Documentation above is a method of 
ModelForm but I have rendered my form and when I hit the SUBMIT button the 
edited fields are returned in a WSGI type object which does not have a save 
method.

I can use the POST data and pass the PK and so on, and update the record 
manually with some code. BUT WHAT is the use of a .SAVE method on a 
ModelForm. In order to edit the form I need to RENDER it right?

Is there a way to return the ModelForm object with the edited fields and 
then save back to the database?

Thanks 

Moose

 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6ccb9692-5f95-4f8a-86b1-18259b00c0dan%40googlegroups.com.


Re: Newbie looking for some help with Postgres <> Django connection

2020-11-09 Thread Marc Johnson
Hi David,

Thanks again for the input. I havent quite figured it out yet but I
appreciate the help!

Best,
Marc

On Thu, Nov 5, 2020 at 8:02 AM David Nugent  wrote:

>
>
> On 5 Nov 2020, at 04:11, Marc Johnson  wrote:
>
> Hi David,
>
> Thanks again for the feedback. When I remove the 'ENGINE' variable I get
> the error saying settings.DATABASES is improperly configured, as shown in
> the snapshot attached below.
>
> But when I add the ENGINE variable, like listed below, I get an 'Internal
> Server Error':
>
> DATABASES = {
> 'default': dj_database_url.config(env='DATABASE_URL',
> conn_max_age=1800),
> 'ENGINE': 'django.db.backends.postgresql',
> }
>
> My db settings in my docker-compose.yml file are also provided below:
>
>   db:
> image: postgres:11
> volumes:
>   - postgres_data:/var/lib/postgresql/data/
> environment:
>   - "DATABASE_URL=
> postgresql://postgres:P#ssw0rd@postgres:5432/ndc_data"
>   - "POSTGRES_HOST_AUTH_METHOD=trust"
>   - "POSTGRES_PASSWORD=P#ssw0rd"
>   - "POSTGRES_USER=postgres"
>   - "POSTGRES_DB=ndc_data"
>   - "POSTGRES_HOST=postgres"
> networks:
>   - default
>
> How am I screwing this up so royally!? I did not expect this connection to
> involve so much troubleshooting.
>
>
>
> It shouldn't. Note that env='DATABASE_URL' is entirely redundant and can
> be omitted.
>
> In any case, check the source code for dj_database_url.config to
> troubleshoot this, but ENGINE definitely isn't needed here. As you'll see
> from the source, the url scheme determines the engine used.
>
> Did you validate that DATABASE_URL is set correctly in the container
> environment?
> I suspect this may be the issue here, although the docker-compose.yml
> looks fine.
>
> Regards,
> /d
>
>
>

-- 
M: +1-646-541-2108
W: marcjohnson.info 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACH3BCSBvDA3k74kn0XLv%3DeD%3DmqrSX16jTHPxTLRVCqH8Jk4Yg%40mail.gmail.com.


Re: Newbie looking for some help with Postgres <> Django connection

2020-11-05 Thread David Nugent


On 5 Nov 2020, at 04:11, Marc Johnson 
mailto:marcjohnson...@gmail.com>> wrote:

Hi David,

Thanks again for the feedback. When I remove the 'ENGINE' variable I get the 
error saying settings.DATABASES is improperly configured, as shown in the 
snapshot attached below.

But when I add the ENGINE variable, like listed below, I get an 'Internal 
Server Error':

DATABASES = {
'default': dj_database_url.config(env='DATABASE_URL', conn_max_age=1800),
'ENGINE': 'django.db.backends.postgresql',
}

My db settings in my docker-compose.yml file are also provided below:

  db:
image: postgres:11
volumes:
  - postgres_data:/var/lib/postgresql/data/
environment:
  - "DATABASE_URL=postgresql://postgres:P#ssw0rd@postgres:5432/ndc_data"
  - "POSTGRES_HOST_AUTH_METHOD=trust"
  - "POSTGRES_PASSWORD=P#ssw0rd"
  - "POSTGRES_USER=postgres"
  - "POSTGRES_DB=ndc_data"
  - "POSTGRES_HOST=postgres"
networks:
  - default

How am I screwing this up so royally!? I did not expect this connection to 
involve so much troubleshooting.


It shouldn't. Note that env='DATABASE_URL' is entirely redundant and can be 
omitted.

In any case, check the source code for dj_database_url.config to troubleshoot 
this, but ENGINE definitely isn't needed here. As you'll see from the source, 
the url scheme determines the engine used.

Did you validate that DATABASE_URL is set correctly in the container 
environment?
I suspect this may be the issue here, although the docker-compose.yml looks 
fine.

Regards,
/d


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA458F7B-A42B-4852-B9DA-FD913A151FE8%40uniquode.io.


Re: Newbie looking for some help with Postgres <> Django connection

2020-11-03 Thread David Nugent
On 4 Nov 2020, at 03:45, Marc Johnson 
mailto:marcjohnson...@gmail.com>> wrote:
...
1. Since this app is dockerized, I have my existing env vars in my 
docker-compose-prod.yml file. Is that where I should list DATABASE_URL? Like:

db:
image: postgres:11
volumes:
  - postgres_data:/var/lib/postgresql/data/
environment:
- DATABASE_URL=postgresql://:@:/


Looks good, but to be certain jump into your container (exec or run) and verify 
that the DATABASE_URL is set correctly. It should be.


2. Does the below formatting look correct to you from my settings.py? I am 
running into issues with the env var DATABASE_URL and getting this error:  
Environment variable "{}" not set'

DATABASES = {
'default': dj_database_url.config(env("DATABASE_URL"), 
default="postgres://postgres@db/postgres", conn_max_age=1800),
'ENGINE': 'django.db.backends.postgresql',
}

There was a mistake in my previous response, so looks like that led you astray.

First, omit "ENGINE" here - unnecessary as postgres (or postgresql) scheme in 
the URL will drive that.

Second, you don't need to specify "DATABASE_URL" directly, that is the default 
variable used if you don't override it, or you can specify 'DATABASE_URL' 
there, or use env='DATABASE_URL'. Your choice.

If you do extract the url prior calling .config(), then use the  default= 
keyword, even though DATABASE_URL will override it. If you pass a positional 
argument to .config it will be used as the environment variable, not the value. 
If you have an already extracted value, then alternatively you can use .parse() 
instead of .config() which takes the url as the first positional arg.

dj_database_url is a pretty simple single module package. Check out the source 
code, it isn't too hard to comprehend.

DATABASES = {
'default': dj_database_url.config(conn_max_age=1800)
}

should do the trick on heroku.

3. I am also getting this error when running locally. Do you have any advice 
for troubleshooting?

web_1  | [2020-11-03 16:35:59 +] [7] [ERROR] Error handling request /NDCs/
web_1  | Traceback (most recent call last):
web_1  |   File 
"/usr/local/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 134, in 
handle
web_1  | self.handle_request(listener, req, client, addr)
web_1  |   File 
"/usr/local/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 175, in 
handle_request
web_1  | respiter = self.wsgi(environ, resp.start_response)
web_1  |   File 
"/usr/local/lib/python3.8/site-packages/django/core/handlers/wsgi.py", line 
131, in __call__
web_1  | signals.request_started.send(sender=self.__class__, 
environ=environ)
web_1  |   File 
"/usr/local/lib/python3.8/site-packages/django/dispatch/dispatcher.py", line 
177, in send
web_1  | return [
web_1  |   File 
"/usr/local/lib/python3.8/site-packages/django/dispatch/dispatcher.py", line 
178, in 
web_1  | (receiver, receiver(signal=self, sender=sender, **named))
web_1  |   File "/usr/local/lib/python3.8/site-packages/django/db/__init__.py", 
line 46, in reset_queries
web_1  | for conn in connections.all():
web_1  |   File "/usr/local/lib/python3.8/site-packages/django/db/utils.py", 
line 229, in all
web_1  | return [self[alias] for alias in self]
web_1  |   File "/usr/local/lib/python3.8/site-packages/django/db/utils.py", 
line 229, in 
web_1  | return [self[alias] for alias in self]
web_1  |   File "/usr/local/lib/python3.8/site-packages/django/db/utils.py", 
line 211, in __getitem__
web_1  | self.ensure_defaults(alias)
web_1  |   File "/usr/local/lib/python3.8/site-packages/django/db/utils.py", 
line 176, in ensure_defaults
web_1  | conn.setdefault('ATOMIC_REQUESTS', False)
web_1  | AttributeError: 'str' object has no attribute 'setdefault'

I think this is the fallout from above, passing the url as the first positional 
instead of an environment variable name or just omitting it.




-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3BF1BFA9-00EB-40D2-9EED-5DF1B2313BD5%40uniquode.io.


Re: Newbie looking for some help with Postgres <> Django connection

2020-11-03 Thread Marc Johnson
Hi David,

Thanks for the feedback!

I'm checking out dj_database_url and have a few follow up questions I was
hoping you (or someone) could help me with.

1. Since this app is dockerized, I have my existing env vars in my
docker-compose-prod.yml file. Is that where I should list DATABASE_URL?
Like:






*db:image: postgres:11volumes:  -
postgres_data:/var/lib/postgresql/data/environment:-
DATABASE_URL=postgresql://:@:/
- *2. Does the below formatting look correct to you from my settings.py? I
am running into issues with the env var DATABASE_URL and getting this
error:  Environment variable "{}" not set'





*DATABASES = {'default': dj_database_url.config(env("DATABASE_URL"),
default="postgres://postgres@db/postgres", conn_max_age=1800),'ENGINE':
'django.db.backends.postgresql',}*
3. I am also getting this error when running locally. Do you have any
advice for troubleshooting?

web_1  | [2020-11-03 16:35:59 +] [7] [ERROR] Error handling request
/NDCs/

web_1  | Traceback (most recent call last):

web_1  |   File
"/usr/local/lib/python3.8/site-packages/gunicorn/workers/sync.py", line
134, in handle

web_1  | self.handle_request(listener, req, client, addr)

web_1  |   File
"/usr/local/lib/python3.8/site-packages/gunicorn/workers/sync.py", line
175, in handle_request

web_1  | respiter = self.wsgi(environ, resp.start_response)

web_1  |   File
"/usr/local/lib/python3.8/site-packages/django/core/handlers/wsgi.py", line
131, in __call__

web_1  | signals.request_started.send(sender=self.__class__,
environ=environ)

web_1  |   File
"/usr/local/lib/python3.8/site-packages/django/dispatch/dispatcher.py",
line 177, in send

web_1  | return [

web_1  |   File
"/usr/local/lib/python3.8/site-packages/django/dispatch/dispatcher.py",
line 178, in 

web_1  | (receiver, receiver(signal=self, sender=sender, **named))

web_1  |   File
"/usr/local/lib/python3.8/site-packages/django/db/__init__.py", line 46, in
reset_queries

web_1  | for conn in connections.all():

web_1  |   File
"/usr/local/lib/python3.8/site-packages/django/db/utils.py", line 229, in
all

web_1  | return [self[alias] for alias in self]

web_1  |   File
"/usr/local/lib/python3.8/site-packages/django/db/utils.py", line 229, in


web_1  | return [self[alias] for alias in self]

web_1  |   File
"/usr/local/lib/python3.8/site-packages/django/db/utils.py", line 211, in
__getitem__

web_1  | self.ensure_defaults(alias)

web_1  |   File
"/usr/local/lib/python3.8/site-packages/django/db/utils.py", line 176, in
ensure_defaults

web_1  | conn.setdefault('ATOMIC_REQUESTS', False)

web_1  | AttributeError: 'str' object has no attribute 'setdefault'

Many thanks in advance for any insights.

Best,
Marc

On Sat, Oct 31, 2020 at 11:45 PM David Nugent  wrote:

> It's been a while since I used heroku, but iirc it just uses a formatted
> pg url.
>
> Install the module dj-database-url and use this in settings instead of the
> default DATABASES layout, something like:
>
>
> DATABASES = {
> 'default':
> dj_database_url.config(os.environ['DATABASE_URL'], conn_max_age=1800)
> }
>
>
> Then set DATABASE_URL in the heroku (and your development) environment.
> This setting will be of the form:
>
> DATABASE_URL=postgresql://:@:/
>
>
> Again, its been a while but I also seem to recall that the DATABASE_URL is
> provided to your app automagically(?) a part of the provisioning so does
> not need to be explicitly set there.  Using the dj_database_url module in
> your settings above is the key.
>
>
>
>

-- 
M: +1-646-541-2108
W: marcjohnson.info 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACH3BCQi2f7uybMPb%3DXXmLuczNwX3%2Bi-enyS-4Lmk_%2Ba7etYbw%40mail.gmail.com.


Re: Newbie looking for some help with Postgres <> Django connection

2020-10-31 Thread David Nugent
It's been a while since I used heroku, but iirc it just uses a formatted pg url.

Install the module dj-database-url and use this in settings instead of the 
default DATABASES layout, something like:

DATABASES = {
'default': dj_database_url.config(os.environ['DATABASE_URL'], 
conn_max_age=1800)
}

Then set DATABASE_URL in the heroku (and your development) environment. This 
setting will be of the form:


DATABASE_URL=postgresql://:@:/

Again, its been a while but I also seem to recall that the DATABASE_URL is 
provided to your app automagically(?) a part of the provisioning so does not 
need to be explicitly set there.  Using the dj_database_url module in your 
settings above is the key.



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/652C078D-78A3-4208-95A3-554DB0FA06A6%40uniquode.io.


Newbie looking for some help with Postgres <> Django connection

2020-10-31 Thread Marc Johnson
Hi All,

I'm looking for tips/resources for a problem I'm facing with my Django app: 
https://ndcportal.herokuapp.com/ 

I'm attempting to connect my Dockerized Django app with a PostgreSQL db. 
The postgres db is already populated, and I can access the data via 
pgadmin, but I cannot figure out the appropriate settings in my 
docker-compose.yml & settings.py files to make the postgres db populate my 
django app. 

I've reviewed multiple tutorials/blog posts, including Will Vincents Docker 
& PostgreSQL tutorial 
, 
but I feel like I'm missing one or two final & crucial steps. 

When I change my DB settings for Postgres, & I bring up the app via Docker, 
I continue running into this OperationalError: 



*message:django.db.utils.OperationalError: could not connect to server: 
Connection refused Is the server running on host "db" (172.29.0.2) and 
accepting TCP/IP connections on port 5433?*

Any tips/resources/feedback would be greatly appreciated. Thanks in advance.

Best,
Marc

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5b11f9df-d246-4b25-b9b6-8a67193f413en%40googlegroups.com.


Re: NEWBIE

2019-07-09 Thread vineet daniel
First of all its Django and not Gjango and rather than getting mastery over
a framework in two months Id suggest that you start with python or any
programming language which has OOPs. If you are not sure what that is then
start from very basic of programming. There is no shortcut to success. Have
patience and prepare for a lot of efforts and time. Once you are
comfortable with basics of programming then bump this question again. Best
of luck.

On Tue, 9 Jul 2019, 16:30 Afotro Ben,  wrote:

> Hello,i am new to programming and want to take learn and master web
> development with Gjango.Can anyone here tell me what it takes to doing it
> in 2 months?
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/db91f5d5-c494-4d34-8188-3e9b4279cf3d%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJPbAW8jktY7hG2u5-7-qRKEiK9Dbk%2BB6x%3Deapv2ArB77fUL8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: NEWBIE

2019-07-09 Thread Jani Tiainen
And to give some perspective I have been working with Django @work last 10
years and I'm still far from mastering it. I'm pretty good with Django
though.

In other words it really takes a lot. Interns at work do get hang of basics
in about two months but really them to get up to speed takes somewhere
around half a year. And this is for people who do work about 8 hrs day, 5
days a week.

ti 9. heinäk. 2019 klo 14.00 Afotro Ben  kirjoitti:

> Hello,i am new to programming and want to take learn and master web
> development with Gjango.Can anyone here tell me what it takes to doing it
> in 2 months?
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/db91f5d5-c494-4d34-8188-3e9b4279cf3d%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91ochAgLN%3DfoO4DzQCk23wO1rMjVyA6jBK47ywiJeiLww5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: NEWBIE

2019-07-09 Thread Javier Rivera
If you have no previous programing experience, a miracle. If you are 
already proficient with Python two months are enough to get comfortable 
with Django, but you will likely still be far from mastery.


Best regards,

Javier.

O 09/07/19 ás 11:34, Afotro Ben escribiu:
Hello,i am new to programming and want to take learn and master web 
development with Gjango.Can anyone here tell me what it takes to doing 
it in 2 months?


--
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/db91f5d5-c494-4d34-8188-3e9b4279cf3d%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/02fb17a3-1875-d4d7-3ab5-1ca1d6a42b3c%40castroparga.com.
For more options, visit https://groups.google.com/d/optout.


NEWBIE

2019-07-09 Thread Afotro Ben
Hello,i am new to programming and want to take learn and master web 
development with Gjango.Can anyone here tell me what it takes to doing it 
in 2 months?

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/db91f5d5-c494-4d34-8188-3e9b4279cf3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question : running the makemigrations command in the terminal

2019-03-30 Thread kamibarut609
@jgi...@caktusgroup.com  Thank you for your help, I received some help on 
Stackoverflow.
@ Krishna Tulsyan Thank you for your help, I received some help on 
Stackoverflow.

On Friday, 29 March 2019 12:37:05 UTC+1, Krishna Tulsyan wrote:
>
> Hi,
> can you provide the folder structure of your app, and apps.py file
> ensure that the name of the app is 'munichlivin_app' and name of the class 
> in apps.py is 'MunichLivingConfig'
>
> On Thursday, March 28, 2019 at 9:05:46 PM UTC+5:30, kamiba...@gmail.com 
> wrote:
>>
>> Hello,
>>
>> (Newbie here): I am trying to run the makemigrations icommand in my 
>> terminal. You will find here below the three relevant files, the third one 
>> showing the errors displayed in 
>> the terminal. 
>>
>> My settings.py file:
>>
>>
>> https://pastebin.com/raw/xLpX0Zfg
>>
>>
>> My models.py file: 
>>
>> https://pastebin.com/raw/wYfSy8ET
>>
>>
>> The terminal entry (with the errors)
>>
>>
>> https://pastebin.com/raw/Pmpnepf1
>>
>>
>> Thank you for your time and your help.
>>
>>
>> K.
>>
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cf03abe8-23b6-4709-a2ff-07c06f3da8e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question : running the makemigrations command in the terminal

2019-03-29 Thread Krishna Tulsyan
Hi,
can you provide the folder structure of your app, and apps.py file
ensure that the name of the app is 'munichlivin_app' and name of the class 
in apps.py is 'MunichLivingConfig'

On Thursday, March 28, 2019 at 9:05:46 PM UTC+5:30, kamiba...@gmail.com 
wrote:
>
> Hello,
>
> (Newbie here): I am trying to run the makemigrations icommand in my 
> terminal. You will find here below the three relevant files, the third one 
> showing the errors displayed in 
> the terminal. 
>
> My settings.py file:
>
>
> https://pastebin.com/raw/xLpX0Zfg
>
>
> My models.py file: 
>
> https://pastebin.com/raw/wYfSy8ET
>
>
> The terminal entry (with the errors)
>
>
> https://pastebin.com/raw/Pmpnepf1
>
>
> Thank you for your time and your help.
>
>
> K.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/67c7a2fd-0697-45bf-b591-d7d0b0bdcfbb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question : running the makemigrations command in the terminal

2019-03-28 Thread jgibson
>From your settings file:
 

> munichliving_app.apps.MunichLivingConfig
>
>
That makes me think that the structure of your project looks something like 
this:

\munichliving_app\manage.py
\munichliving_app\apps\MunichLivingConfig\
\munichliving_app\apps\MunichLivingConfig\models.py
\munichliving_app\apps\MunichLivingConfig\views.py
\munichliving_app\apps\MunichLivingConfig\admin.py





And `OffererProfile` is defined inside models. Is that correct?

On Thursday, March 28, 2019 at 11:35:46 AM UTC-4, kamiba...@gmail.com wrote:
>
> Hello,
>
> (Newbie here): I am trying to run the makemigrations icommand in my 
> terminal. You will find here below the three relevant files, the third one 
> showing the errors displayed in 
> the terminal. 
>
> My settings.py file:
>
>
> https://pastebin.com/raw/xLpX0Zfg
>
>
> My models.py file: 
>
> https://pastebin.com/raw/wYfSy8ET
>
>
> The terminal entry (with the errors)
>
>
> https://pastebin.com/raw/Pmpnepf1
>
>
> Thank you for your time and your help.
>
>
> K.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9d5f73c3-0335-4003-8162-5c72aa07f723%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question : running the makemigrations command in the terminal

2019-03-28 Thread kamibarut609


On Thursday, 28 March 2019 16:35:46 UTC+1, kamiba...@gmail.com wrote:
>
> Hello,
>
> (Newbie here): I am trying to run the makemigrations icommand in my 
> terminal. You will find here below the three relevant files, the third one 
> showing the errors displayed in 
> the terminal. 
>
> My settings.py file:
>
>
> https://pastebin.com/raw/xLpX0Zfg
>
>
> My models.py file: 
>
> https://pastebin.com/raw/wYfSy8ET
>
>
> The terminal entry (with the errors)
>
>
> https://pastebin.com/raw/Pmpnepf1
>
>
>
No matter the changes I make in the apps.py, settings.py and models.py 
files, I always read in the terminal :

 "  No changes detected in app 'munichliving_app'

 ( I am using Python 3.6 and Django 2.7.1)
 

>  Thank you for your time and your help.
>
>
> K.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a62b4366-e47b-468a-a562-3ceb8fe69e27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Newbie question : running the makemigrations command in the terminal

2019-03-28 Thread kamibarut609
Hello,

(Newbie here): I am trying to run the makemigrations icommand in my 
terminal. You will find here below the three relevant files, the third one 
showing the errors displayed in 
the terminal. 

My settings.py file:


https://pastebin.com/raw/xLpX0Zfg


My models.py file: 

https://pastebin.com/raw/wYfSy8ET


The terminal entry (with the errors)


https://pastebin.com/raw/Pmpnepf1


Thank you for your time and your help.


K.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b5c8fbee-2eff-4bcc-8474-5779f8e0fc11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I am newbie to Django REST,

2019-02-09 Thread Dom Delbuco
I've been watching this guys tuts, extremely solid
https://www.youtube.com/watch?v=UmljXZIypDc

On Saturday, February 2, 2019 at 8:15:27 AM UTC-5, shubham joshi wrote:
>
>  How to use cookeicutter for setting up new project?
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/75d9d130-1459-47bb-bd57-2635747069b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


I am newbie to Django REST,

2019-02-02 Thread shubham joshi
 How to use cookeicutter for setting up new project?

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d8bacb8e-d73f-4264-8479-ace7243932ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie : Object copy - weird error :-)

2018-07-13 Thread mickael . barbo
Thanks you Melvyn, this is it :-)

Have a nice day.

Regards

Le mardi 3 juillet 2018 00:34:14 UTC+2, Melvyn Sopacua a écrit :
>
> On vrijdag 29 juni 2018 09:44:40 CEST Mickael Barbo wrote:
>
>  
>
> > I try to create a way to archive (copy) the same object instance on an
>
> > other DataBase.
>
> > 
>
> > I followed this advice : # https://stackoverflow.com/
>
> > questions/21699707/python-how-to-copy-all-attibutes-from-
>
> > base-class-to-derived-one
>
>  
>
> That advice is for normal python classes. Django models have some 
> restrictions, one being that fields are special attributes. Messing with a 
> model's __init__() is not something you normally do as a model's class 
> creation is highly customized.
>
>  
>
> If you're really using 2 different databases, a model's save() operation 
> supports a `using` keyword that allows you to select the database 
> connection 
> .
>  
> Archiving becomes really easy that way.
>
>  
>
>  
>
> -- 
>
> Melvyn Sopacua
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a3f21016-62ab-43cc-9c3a-164797a602c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie : Object copy - weird error :-)

2018-07-02 Thread Melvyn Sopacua
On vrijdag 29 juni 2018 09:44:40 CEST Mickael Barbo wrote:

> I try to create a way to archive (copy) the same object instance on an
> other DataBase.
> 
> I followed this advice : # https://stackoverflow.com/
> questions/21699707/python-how-to-copy-all-attibutes-from-
> base-class-to-derived-one

That advice is for normal python classes. Django models have some restrictions, 
one 
being that fields are special attributes. Messing with a model's __init__() is 
not something 
you normally do as a model's class creation is highly customized.

If you're really using 2 different databases, a model's save() operation 
supports a `using` 
keyword that allows you to select the database connection[1]. Archiving becomes 
really 
easy that way.


-- 
Melvyn Sopacua


[1] 
https://docs.djangoproject.com/en/2.0/topics/db/multi-db/#selecting-a-database-for-save

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2130083.vAuLGcjiVo%40fritzbook.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie : Object copy - weird error :-)

2018-06-29 Thread Mickael Barbo
Hello  Julio,

Ok, I see.

I try to create a way to archive (copy) the same object instance on an
other DataBase.

I followed this advice : # https://stackoverflow.com/
questions/21699707/python-how-to-copy-all-attibutes-from-
base-class-to-derived-one


2018-06-27 14:56 GMT+02:00 Julio Biason :

> Hi Mikael,
>
> The problem is happening because of this: __init__() takes from 1 to 2
> positional arguments but 11 were given
>
> On your new __init__(), you added just 2 parameters: `self` and `source`.
> But you overwrote the default `models.Model` init, which receives way more
> parameters (the original signature for this function is `__init__(self,
> *args, **kwargs)`).
>
> What are you actually trying to achieve with this?
>
> On Tue, Jun 26, 2018 at 1:17 PM,  wrote:
>
>> Hi all :-)
>>
>> I'd like to archive some data.
>>
>> I did that :
>>
>> class AbstractDataModel(models.Model):
>>
>> xxx
>>
>>
>> class Meta:
>> abstract = True
>>
>>
>> def __iter__(self):
>>
>> return iter([self.xxx, self.yyy, self.zzz, self.aaa,
>> self.qqq, self.mode_bbb])
>>
>>
>> class DataModel(AbstractDataModel):
>>
>>
>> pass
>>
>>
>> class DataModelArchive(AbstractDataModel):
>> # https://stackoverflow.com/questions/21699707/python-how-to-
>> copy-all-attibutes-from-base-class-to-derived-one
>> def __init__(self, source=None):
>> if source is not None:
>> self.__dict__.update(source.__dict__)
>>
>>
>>
>> But when I want to access data in DataModelArchive, like
>> DataModelArchive.objects.all() for example,
>> I get
>>
>>
>> Traceback (most recent call last):
>>   File "/home/.../tests.py", line 1090, in test_archive
>> print(DataModelArchive.objects.all())
>>   File "/home/.../venv/lib/python3.6/site-packages/django/db/models
>> /query.py", line 248, in __repr__
>> data = list(self[:REPR_OUTPUT_SIZE + 1])
>>   File "/home/.../venv/lib/python3.6/site-packages/django/db/models
>> /query.py", line 272, in __iter__
>> self._fetch_all()
>>   File "/home/.../venv/lib/python3.6/site-packages/django/db/models
>> /query.py", line 1179, in _fetch_all
>> self._result_cache = list(self._iterable_class(self))
>>   File "/home/.../venv/lib/python3.6/site-packages/django/db/models
>> /query.py", line 63, in __iter__
>> obj = model_cls.from_db(db, init_list, row[model_fields_start:model_f
>> ields_end])
>>   File "/home/.../lib/python3.6/site-packages/django/db/models/base.py",
>> line 507, in from_db
>> new = cls(*values)
>> TypeError: __init__() takes from 1 to 2 positional arguments but 11 were
>> given
>>
>>
>>
>> What am I doing wrong ?
>>
>> Thx
>> ;-)
>>
>> --
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/ac3a7a8f-f878-48b3-943a-eb47f6b03e7e%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> *Julio Biason*, Sofware Engineer
> *AZION*  |  Deliver. Accelerate. Protect.
> Office: +55 51 3083 8101   |  Mobile: +55 51
> *99907 0554*
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/gHKY0BAcTi4/unsubscribe.
> To unsubscribe from this group and all its topics, 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAEM7gE2y%3DQHEJdbwUMbhmxDnY8%
> 2BEHSVdUKUJtgbGTX2UgoWKSA%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPLHwtwGKQm_%3DMaft4vNnFQjf00Cmyw8UkLdq6W_aAmi5KVNgQ%40mail.gmail.com.
For more options, visit 

Re: Newbie : Object copy - weird error :-)

2018-06-29 Thread Mickael Barbo
Hi 赖信桃,

Sorry for formating problem. Here it is

class AbstractDataModel(models.Model):

xxx


class Meta:
abstract = True


def __iter__(self):

 return iter([self.xxx, self.yyy, self.zzz, self.aaa,
  self.qqq, self.mode_bbb])


class DataModel(AbstractDataModel):

pass


class DataModelArchive(AbstractDataModel):
# https://stackoverflow.com/questions/21699707/python-how-
to-copy-all-attibutes-from-base-class-to-derived-one
def __init__(self, source=None):
if source is not None:
self.__dict__.update(source.__dict__)



2018-06-27 4:34 GMT+02:00 赖信桃 :

> Can you format your code or post it on a gist?
> On Wed, Jun 27, 2018 at 00:17  wrote:
>
>> Hi all :-)
>>
>> I'd like to archive some data.
>>
>> I did that :
>>
>> class AbstractDataModel(models.Model):
>>
>> xxx
>>
>>
>> class Meta:
>> abstract = True
>>
>>
>> def __iter__(self):
>>
>> return iter([self.xxx, self.yyy, self.zzz, self.aaa,
>> self.qqq, self.mode_bbb])
>>
>>
>> class DataModel(AbstractDataModel):
>>
>>
>> pass
>>
>>
>> class DataModelArchive(AbstractDataModel):
>> # https://stackoverflow.com/questions/21699707/python-how-
>> to-copy-all-attibutes-from-base-class-to-derived-one
>> def __init__(self, source=None):
>> if source is not None:
>> self.__dict__.update(source.__dict__)
>>
>>
>>
>> But when I want to access data in DataModelArchive, like
>> DataModelArchive.objects.all() for example,
>> I get
>>
>>
>> Traceback (most recent call last):
>>   File "/home/.../tests.py", line 1090, in test_archive
>> print(DataModelArchive.objects.all())
>>   File "/home/.../venv/lib/python3.6/site-packages/django/db/
>> models/query.py", line 248, in __repr__
>> data = list(self[:REPR_OUTPUT_SIZE + 1])
>>   File "/home/.../venv/lib/python3.6/site-packages/django/db/
>> models/query.py", line 272, in __iter__
>> self._fetch_all()
>>   File "/home/.../venv/lib/python3.6/site-packages/django/db/
>> models/query.py", line 1179, in _fetch_all
>> self._result_cache = list(self._iterable_class(self))
>>   File "/home/.../venv/lib/python3.6/site-packages/django/db/
>> models/query.py", line 63, in __iter__
>> obj = model_cls.from_db(db, init_list, row[model_fields_start:model_
>> fields_end])
>>   File "/home/.../lib/python3.6/site-packages/django/db/models/base.py",
>> line 507, in from_db
>> new = cls(*values)
>> TypeError: __init__() takes from 1 to 2 positional arguments but 11 were
>> given
>>
>>
>>
>> What am I doing wrong ?
>>
>> Thx
>> ;-)
>>
>> --
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-users/ac3a7a8f-f878-48b3-943a-eb47f6b03e7e%
>> 40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/gHKY0BAcTi4/unsubscribe.
> To unsubscribe from this group and all its topics, 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAMv51WTXNjz1Px76v5_7P%2BMmUnbHH8Yw%2BdwJPR%
> 2BX7ccorHPZBA%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPLHwtx5_z8B47oVsodDNnp9hy%3DbjSK5GsmT%3DZ1k%3DZp2kgNDtQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie : Object copy - weird error :-)

2018-06-27 Thread Julio Biason
Hi Mikael,

The problem is happening because of this: __init__() takes from 1 to 2
positional arguments but 11 were given

On your new __init__(), you added just 2 parameters: `self` and `source`.
But you overwrote the default `models.Model` init, which receives way more
parameters (the original signature for this function is `__init__(self,
*args, **kwargs)`).

What are you actually trying to achieve with this?

On Tue, Jun 26, 2018 at 1:17 PM,  wrote:

> Hi all :-)
>
> I'd like to archive some data.
>
> I did that :
>
> class AbstractDataModel(models.Model):
>
> xxx
>
>
> class Meta:
> abstract = True
>
>
> def __iter__(self):
>
> return iter([self.xxx, self.yyy, self.zzz, self.aaa,
> self.qqq, self.mode_bbb])
>
>
> class DataModel(AbstractDataModel):
>
>
> pass
>
>
> class DataModelArchive(AbstractDataModel):
> # https://stackoverflow.com/questions/21699707/python-how-
> to-copy-all-attibutes-from-base-class-to-derived-one
> def __init__(self, source=None):
> if source is not None:
> self.__dict__.update(source.__dict__)
>
>
>
> But when I want to access data in DataModelArchive, like
> DataModelArchive.objects.all() for example,
> I get
>
>
> Traceback (most recent call last):
>   File "/home/.../tests.py", line 1090, in test_archive
> print(DataModelArchive.objects.all())
>   File "/home/.../venv/lib/python3.6/site-packages/django/db/
> models/query.py", line 248, in __repr__
> data = list(self[:REPR_OUTPUT_SIZE + 1])
>   File "/home/.../venv/lib/python3.6/site-packages/django/db/
> models/query.py", line 272, in __iter__
> self._fetch_all()
>   File "/home/.../venv/lib/python3.6/site-packages/django/db/
> models/query.py", line 1179, in _fetch_all
> self._result_cache = list(self._iterable_class(self))
>   File "/home/.../venv/lib/python3.6/site-packages/django/db/
> models/query.py", line 63, in __iter__
> obj = model_cls.from_db(db, init_list, row[model_fields_start:model_
> fields_end])
>   File "/home/.../lib/python3.6/site-packages/django/db/models/base.py",
> line 507, in from_db
> new = cls(*values)
> TypeError: __init__() takes from 1 to 2 positional arguments but 11 were
> given
>
>
>
> What am I doing wrong ?
>
> Thx
> ;-)
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/ac3a7a8f-f878-48b3-943a-eb47f6b03e7e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Julio Biason*, Sofware Engineer
*AZION*  |  Deliver. Accelerate. Protect.
Office: +55 51 3083 8101   |  Mobile: +55 51
*99907 0554*

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEM7gE2y%3DQHEJdbwUMbhmxDnY8%2BEHSVdUKUJtgbGTX2UgoWKSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie : Object copy - weird error :-)

2018-06-26 Thread 赖信桃
Can you format your code or post it on a gist?
On Wed, Jun 27, 2018 at 00:17  wrote:

> Hi all :-)
>
> I'd like to archive some data.
>
> I did that :
>
> class AbstractDataModel(models.Model):
>
> xxx
>
>
> class Meta:
> abstract = True
>
>
> def __iter__(self):
>
> return iter([self.xxx, self.yyy, self.zzz, self.aaa,
> self.qqq, self.mode_bbb])
>
>
> class DataModel(AbstractDataModel):
>
>
> pass
>
>
> class DataModelArchive(AbstractDataModel):
> #
> https://stackoverflow.com/questions/21699707/python-how-to-copy-all-attibutes-from-base-class-to-derived-one
> def __init__(self, source=None):
> if source is not None:
> self.__dict__.update(source.__dict__)
>
>
>
> But when I want to access data in DataModelArchive, like
> DataModelArchive.objects.all() for example,
> I get
>
>
> Traceback (most recent call last):
>   File "/home/.../tests.py", line 1090, in test_archive
> print(DataModelArchive.objects.all())
>   File
> "/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py",
> line 248, in __repr__
> data = list(self[:REPR_OUTPUT_SIZE + 1])
>   File
> "/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py",
> line 272, in __iter__
> self._fetch_all()
>   File
> "/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py",
> line 1179, in _fetch_all
> self._result_cache = list(self._iterable_class(self))
>   File
> "/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py",
> line 63, in __iter__
> obj = model_cls.from_db(db, init_list, row[model_fields_start:
> model_fields_end])
>   File "/home/.../lib/python3.6/site-packages/django/db/models/base.py",
> line 507, in from_db
> new = cls(*values)
> TypeError: __init__() takes from 1 to 2 positional arguments but 11 were
> given
>
>
>
> What am I doing wrong ?
>
> Thx
> ;-)
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ac3a7a8f-f878-48b3-943a-eb47f6b03e7e%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMv51WTXNjz1Px76v5_7P%2BMmUnbHH8Yw%2BdwJPR%2BX7ccorHPZBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie : Object copy - weird error :-)

2018-06-26 Thread mickael . barbo
Error typo, I creates a new thread with the good description ;-)

Le mardi 26 juin 2018 16:35:27 UTC+2, Nelson Varela a écrit :
>
> The following class is kinda weird:
> class DataModel(DataModel):
>
> A class which inherits itself???
>
>
>
> On Tuesday, June 26, 2018 at 11:31:24 AM UTC+2, mickae...@gmail.com wrote:
>>
>> Hi all :-)
>>
>> I'd like to archive some data.
>>
>> I did that :
>>
>> class AbstractDataModel(models.Model):
>> xxx
>>
>> class Meta:
>> abstract = True
>>
>>
>> def __iter__(self):
>>
>> return iter([self.xxx, self.yyy, self.zzz, self.aaa,
>> self.qqq, self.mode_bbb])
>>
>>
>> class DataModel(DataModel):
>>
>> pass
>>
>>
>> class DataModelArchive(DataModel):
>> # 
>> https://stackoverflow.com/questions/21699707/python-how-to-copy-all-attibutes-from-base-class-to-derived-one
>> def __init__(self, source=None):
>> if source is not None:
>> self.__dict__.update(source.__dict__)
>>
>>
>> But when I want to access data in DataModelArchive, like 
>> DataModelArchive.objects.all() for example,
>> I get 
>>
>> Traceback (most recent call last):
>>   File "/home/.../tests.py", line 1090, in test_archive
>> print(DataModelArchive.objects.all())
>>   File 
>> "/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
>> line 248, in __repr__
>> data = list(self[:REPR_OUTPUT_SIZE + 1])
>>   File 
>> "/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
>> line 272, in __iter__
>> self._fetch_all()
>>   File 
>> "/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
>> line 1179, in _fetch_all
>> self._result_cache = list(self._iterable_class(self))
>>   File 
>> "/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
>> line 63, in __iter__
>> obj = model_cls.from_db(db, init_list, row[model_fields_start:
>> model_fields_end])
>>   File "/home/.../lib/python3.6/site-packages/django/db/models/base.py", 
>> line 507, in from_db
>> new = cls(*values)
>> TypeError: __init__() takes from 1 to 2 positional arguments but 11 were 
>> given
>>
>> What am I doing wrong ?
>>
>> Thx
>>
>>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d1051e67-7456-4263-937e-e7d0541334b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Newbie : Object copy - weird error :-)

2018-06-26 Thread mickael . barbo
Hi all :-)

I'd like to archive some data.

I did that :

class AbstractDataModel(models.Model):

xxx


class Meta:
abstract = True


def __iter__(self):

return iter([self.xxx, self.yyy, self.zzz, self.aaa,
self.qqq, self.mode_bbb])


class DataModel(AbstractDataModel):


pass


class DataModelArchive(AbstractDataModel):
# 
https://stackoverflow.com/questions/21699707/python-how-to-copy-all-attibutes-from-base-class-to-derived-one
def __init__(self, source=None):
if source is not None:
self.__dict__.update(source.__dict__)



But when I want to access data in DataModelArchive, like 
DataModelArchive.objects.all() for example,
I get 


Traceback (most recent call last):
  File "/home/.../tests.py", line 1090, in test_archive
print(DataModelArchive.objects.all())
  File 
"/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
line 248, in __repr__
data = list(self[:REPR_OUTPUT_SIZE + 1])
  File 
"/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
line 272, in __iter__
self._fetch_all()
  File 
"/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
line 1179, in _fetch_all
self._result_cache = list(self._iterable_class(self))
  File 
"/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
line 63, in __iter__
obj = model_cls.from_db(db, init_list, row[model_fields_start:
model_fields_end])
  File "/home/.../lib/python3.6/site-packages/django/db/models/base.py", 
line 507, in from_db
new = cls(*values)
TypeError: __init__() takes from 1 to 2 positional arguments but 11 were 
given



What am I doing wrong ?

Thx
;-)

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ac3a7a8f-f878-48b3-943a-eb47f6b03e7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie : Object copy - weird error :-)

2018-06-26 Thread Nelson Varela
The following class is kinda weird:
class DataModel(DataModel):

A class which inherits itself???



On Tuesday, June 26, 2018 at 11:31:24 AM UTC+2, mickae...@gmail.com wrote:
>
> Hi all :-)
>
> I'd like to archive some data.
>
> I did that :
>
> class AbstractDataModel(models.Model):
> xxx
>
> class Meta:
> abstract = True
>
>
> def __iter__(self):
>
> return iter([self.xxx, self.yyy, self.zzz, self.aaa,
> self.qqq, self.mode_bbb])
>
>
> class DataModel(DataModel):
>
> pass
>
>
> class DataModelArchive(DataModel):
> # 
> https://stackoverflow.com/questions/21699707/python-how-to-copy-all-attibutes-from-base-class-to-derived-one
> def __init__(self, source=None):
> if source is not None:
> self.__dict__.update(source.__dict__)
>
>
> But when I want to access data in DataModelArchive, like 
> DataModelArchive.objects.all() for example,
> I get 
>
> Traceback (most recent call last):
>   File "/home/.../tests.py", line 1090, in test_archive
> print(DataModelArchive.objects.all())
>   File 
> "/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
> line 248, in __repr__
> data = list(self[:REPR_OUTPUT_SIZE + 1])
>   File 
> "/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
> line 272, in __iter__
> self._fetch_all()
>   File 
> "/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
> line 1179, in _fetch_all
> self._result_cache = list(self._iterable_class(self))
>   File 
> "/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
> line 63, in __iter__
> obj = model_cls.from_db(db, init_list, row[model_fields_start:
> model_fields_end])
>   File "/home/.../lib/python3.6/site-packages/django/db/models/base.py", 
> line 507, in from_db
> new = cls(*values)
> TypeError: __init__() takes from 1 to 2 positional arguments but 11 were 
> given
>
> What am I doing wrong ?
>
> Thx
>
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/39aca8ec-6d6c-4e33-8a91-4dadda6620b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Newbie : Object copy - weird error :-)

2018-06-26 Thread mickael . barbo
Hi all :-)

I'd like to archive some data.

I did that :

class AbstractDataModel(models.Model):
xxx

class Meta:
abstract = True


def __iter__(self):

return iter([self.xxx, self.yyy, self.zzz, self.aaa,
self.qqq, self.mode_bbb])


class DataModel(DataModel):

pass


class DataModelArchive(DataModel):
# 
https://stackoverflow.com/questions/21699707/python-how-to-copy-all-attibutes-from-base-class-to-derived-one
def __init__(self, source=None):
if source is not None:
self.__dict__.update(source.__dict__)


But when I want to access data in DataModelArchive, like 
DataModelArchive.objects.all() for example,
I get 

Traceback (most recent call last):
  File "/home/.../tests.py", line 1090, in test_archive
print(DataModelArchive.objects.all())
  File 
"/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
line 248, in __repr__
data = list(self[:REPR_OUTPUT_SIZE + 1])
  File 
"/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
line 272, in __iter__
self._fetch_all()
  File 
"/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
line 1179, in _fetch_all
self._result_cache = list(self._iterable_class(self))
  File 
"/home/.../venv/lib/python3.6/site-packages/django/db/models/query.py", 
line 63, in __iter__
obj = model_cls.from_db(db, init_list, row[model_fields_start:
model_fields_end])
  File "/home/.../lib/python3.6/site-packages/django/db/models/base.py", 
line 507, in from_db
new = cls(*values)
TypeError: __init__() takes from 1 to 2 positional arguments but 11 were 
given

What am I doing wrong ?

Thx

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/42c0ac75-5255-4573-95cc-097f8b61fe17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Newbie : Implementation possible ?

2018-06-26 Thread mickael . barbo
Hi community :)

I'd like to implement something like "joined image".

In Database, I'd like CoreObject to have the key of "Object1" OR "Object2" 
OR "Object3" (like foreignKey).

How can I do that ?

The context is that CoreObject is a central DataBaseFile and will receive 
information from one of ObjectX + ObjectX.pk to access ObjectX.

Thanks for your help

Micka

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/99c9f8e1-f0be-428f-abca-8bc65a9666cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: A newbie server error occured

2018-06-14 Thread Artur Gontijo
Hi,

Did you check if you have the admin app listed in the setings.py?
INSTALLED_APPS = [
'django.contrib.admin',
'more_apps',
]

And what about your url.py? Does it have the /admin routing?
path('admin/', admin.site.urls),

On Thursday, June 14, 2018 at 2:28:41 PM UTC-3, Piotr Trybowski wrote:
>
> So I'm following the tutorial from: 
> https://docs.djangoproject.com/en/2.1/intro/tutorial02/ and I'm stuck at 
> opening the admin site.
> When i run command runserver i get no error and prompt: 
>
> "C:\Program Files\JetBrains\PyCharm 2018.1.4\bin\runnerw.exe" 
> C:\Users\Username\Downloads\WinPython-64bit-3.6.2.0Qt5\python-3.6.2.amd64\python.exe
>  
> "C:\Program Files\JetBrains\PyCharm 
> 2018.1.4\helpers\pycharm\django_manage.py" runserver 
> C:/Users/Username/PycharmProjects/strona2
> Tracking file by folder pattern: migrations
> Performing system checks...
>
> System check identified no issues (0 silenced).
> June 14, 2018 - 18:27:17
> Django version 2.0.6, using settings 'strona2.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CTRL-BREAK.
>
>
> So everything should work propperly, but when I open the 
> http://127.0.0.1:8000/admin/ i get this error:
> A server error occured. Please contact the administrator.
>
> I have tried migrating again, I have tried using different port. The 
> /polls/ section works. I asked everywhere and i'm out of ideas. Thanks for 
> your help.
>
> As stated in prompt above I'm using Django 2.0.6 and python 3.6.2. Also 
> I'm on windows and running everything through Pycharm. No problems up to 
> this point
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c0a73843-0527-4378-9826-4633879990d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


A newbie server error occured

2018-06-14 Thread Piotr Trybowski
So I'm following the tutorial 
from: https://docs.djangoproject.com/en/2.1/intro/tutorial02/ and I'm stuck 
at opening the admin site.
When i run command runserver i get no error and prompt: 

"C:\Program Files\JetBrains\PyCharm 2018.1.4\bin\runnerw.exe" 
C:\Users\Username\Downloads\WinPython-64bit-3.6.2.0Qt5\python-3.6.2.amd64\python.exe
 
"C:\Program Files\JetBrains\PyCharm 
2018.1.4\helpers\pycharm\django_manage.py" runserver 
C:/Users/Username/PycharmProjects/strona2
Tracking file by folder pattern: migrations
Performing system checks...

System check identified no issues (0 silenced).
June 14, 2018 - 18:27:17
Django version 2.0.6, using settings 'strona2.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.


So everything should work propperly, but when I open the 
http://127.0.0.1:8000/admin/ i get this error:
A server error occured. Please contact the administrator.

I have tried migrating again, I have tried using different port. The 
/polls/ section works. I asked everywhere and i'm out of ideas. Thanks for 
your help.

As stated in prompt above I'm using Django 2.0.6 and python 3.6.2. Also I'm 
on windows and running everything through Pycharm. No problems up to this 
point

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/99670c95-c396-4e71-a7c6-ce904dd59d06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie : Best data archive strategy

2018-06-12 Thread Mickael Barbo
Ok, so "audit log" is like a "snapshot". I think it's too much for what I
need.

To clarify my needs, I have a data that once "used/read", it's no more
needed.
I just want to keep it "archived", in an other place to get access to it if
I want to add some function (statistics, etc...).

So, Gerardo, it seems to be like " I want to "move" data to an archive
system (data is still relevant and useful)."

Hope this clarify my needs...

Thx Matthew and Gerardo for your help.


2018-06-12 20:38 GMT+02:00 Gerardo Palazuelos Guerrero <
gerardo.palazue...@gmail.com>:

> Hi Mickael,
> When I read Archive, in my mind is a different thing, not the same as
> audit. So, for one moment, think about situation/scenario you are working
> on.
>
> Archive is to manage data purge from my transactional tables; this means I
> want to "delete" data (that has not more value) or I want to "move" data to
> an archive system (data is still relevant and useful).
>
> Audit is to create a perfect tracking of transitions on value overtime.
> This is required due to special regulations you have.
>
> So, it might be useful if you clarify what is the scenario you are trying
> to solve.
>
> Regards,
> Gerardo.
>
>
>
> --
> Gerardo Palazuelos Guerrero
>
>
> On Tue, Jun 12, 2018 at 12:14 PM, Matthew Pava 
> wrote:
>
>> Hi Mickael,
>>
>> It saves a copy of each record every time a record is changed.  But it is
>> saved in a separate table, so it doesn’t change your model’s table.
>>
>>
>>
>> *From:* django-users@googlegroups.com [mailto:django-users@googlegro
>> ups.com] *On Behalf Of *mickael.ba...@gmail.com
>> *Sent:* Tuesday, June 12, 2018 1:17 PM
>> *To:* Django users
>> *Subject:* Re: Newbie : Best data archive strategy
>>
>>
>>
>> Thanks Matthew for your response.
>>
>> I looked at Reversion. If I understand correctly what it did, it
>> duplicate each transaction on internal database ?
>>
>> Le mardi 12 juin 2018 20:01:02 UTC+2, Matthew Pava a écrit :
>>
>> I think what you’re really looking for is an audit log.  There are some
>> Django packages available that do that automatically.
>>
>>
>>
>> You might find this one quite helpful, called Django Reversion:
>>
>> https://github.com/etianen/django-reversion
>>
>>
>>
>>
>>
>> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On
>> Behalf Of *mickae...@gmail.com
>> *Sent:* Tuesday, June 12, 2018 12:22 PM
>> *To:* Django users
>> *Subject:* Newbie : Best data archive strategy
>>
>>
>>
>> Hi,
>>
>> I'd like to archive some data.
>>
>> I came with this idea :
>>
>>
>> class DataModel(models.Model):
>>
>> xxx
>>
>>
>> class DataModelArchive(DataModel):
>>
>> pass
>>
>>
>>
>>
>> The DataModelArchive database created has only "a pointer" to DataModel.
>>
>> I saw a post indicating that I'll have to first create an
>> AbstractDataModel and inherit for it for both DataModelArchive and
>> DataModel.
>>
>> Well, what is the "best way" to archive data using Django ?
>>
>> Thx for your attention
>>
>> Micka
>>
>> --
>> 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...@googlegroups.com.
>> To post to this group, send email to djang...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/ef59e00a-3354-44f5-9c99-5ca85885026e%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/ef59e00a-3354-44f5-9c99-5ca85885026e%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/86e18583-03

Re: Newbie : Best data archive strategy

2018-06-12 Thread Gerardo Palazuelos Guerrero
Hi Mickael,
When I read Archive, in my mind is a different thing, not the same as
audit. So, for one moment, think about situation/scenario you are working
on.

Archive is to manage data purge from my transactional tables; this means I
want to "delete" data (that has not more value) or I want to "move" data to
an archive system (data is still relevant and useful).

Audit is to create a perfect tracking of transitions on value overtime.
This is required due to special regulations you have.

So, it might be useful if you clarify what is the scenario you are trying
to solve.

Regards,
Gerardo.



--
Gerardo Palazuelos Guerrero


On Tue, Jun 12, 2018 at 12:14 PM, Matthew Pava  wrote:

> Hi Mickael,
>
> It saves a copy of each record every time a record is changed.  But it is
> saved in a separate table, so it doesn’t change your model’s table.
>
>
>
> *From:* django-users@googlegroups.com [mailto:django-users@
> googlegroups.com] *On Behalf Of *mickael.ba...@gmail.com
> *Sent:* Tuesday, June 12, 2018 1:17 PM
> *To:* Django users
> *Subject:* Re: Newbie : Best data archive strategy
>
>
>
> Thanks Matthew for your response.
>
> I looked at Reversion. If I understand correctly what it did, it duplicate
> each transaction on internal database ?
>
> Le mardi 12 juin 2018 20:01:02 UTC+2, Matthew Pava a écrit :
>
> I think what you’re really looking for is an audit log.  There are some
> Django packages available that do that automatically.
>
>
>
> You might find this one quite helpful, called Django Reversion:
>
> https://github.com/etianen/django-reversion
>
>
>
>
>
> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On
> Behalf Of *mickae...@gmail.com
> *Sent:* Tuesday, June 12, 2018 12:22 PM
> *To:* Django users
> *Subject:* Newbie : Best data archive strategy
>
>
>
> Hi,
>
> I'd like to archive some data.
>
> I came with this idea :
>
>
> class DataModel(models.Model):
>
> xxx
>
>
> class DataModelArchive(DataModel):
>
> pass
>
>
>
>
> The DataModelArchive database created has only "a pointer" to DataModel.
>
> I saw a post indicating that I'll have to first create an
> AbstractDataModel and inherit for it for both DataModelArchive and
> DataModel.
>
> Well, what is the "best way" to archive data using Django ?
>
> Thx for your attention
>
> Micka
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to djang...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/ef59e00a-3354-44f5-9c99-5ca85885026e%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ef59e00a-3354-44f5-9c99-5ca85885026e%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/86e18583-0376-43f2-8419-b557459b5ca7%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/86e18583-0376-43f2-8419-b557459b5ca7%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/148f20f481e5409a833ea043f771cbda%40ISS1.ISS.LOCAL
> <https://groups.google.com/d/msgid/django-users/148f20f481e5409a833ea043f771cbda%40ISS1.ISS.LOCAL?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django use

RE: Newbie : Best data archive strategy

2018-06-12 Thread Matthew Pava
Hi Mickael,
It saves a copy of each record every time a record is changed.  But it is saved 
in a separate table, so it doesn’t change your model’s table.

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of mickael.ba...@gmail.com
Sent: Tuesday, June 12, 2018 1:17 PM
To: Django users
Subject: Re: Newbie : Best data archive strategy

Thanks Matthew for your response.

I looked at Reversion. If I understand correctly what it did, it duplicate each 
transaction on internal database ?

Le mardi 12 juin 2018 20:01:02 UTC+2, Matthew Pava a écrit :
I think what you’re really looking for is an audit log.  There are some Django 
packages available that do that automatically.

You might find this one quite helpful, called Django Reversion:
https://github.com/etianen/django-reversion


From: django...@googlegroups.com 
[mailto:django...@googlegroups.com] On Behalf Of 
mickae...@gmail.com
Sent: Tuesday, June 12, 2018 12:22 PM
To: Django users
Subject: Newbie : Best data archive strategy

Hi,

I'd like to archive some data.

I came with this idea :


class DataModel(models.Model):
xxx

class DataModelArchive(DataModel):
pass


The DataModelArchive database created has only "a pointer" to DataModel.

I saw a post indicating that I'll have to first create an AbstractDataModel and 
inherit for it for both DataModelArchive and DataModel.

Well, what is the "best way" to archive data using Django ?

Thx for your attention

Micka
--
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...@googlegroups.com.
To post to this group, send email to djang...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ef59e00a-3354-44f5-9c99-5ca85885026e%40googlegroups.com<https://groups.google.com/d/msgid/django-users/ef59e00a-3354-44f5-9c99-5ca85885026e%40googlegroups.com?utm_medium=email_source=footer>.
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<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/86e18583-0376-43f2-8419-b557459b5ca7%40googlegroups.com<https://groups.google.com/d/msgid/django-users/86e18583-0376-43f2-8419-b557459b5ca7%40googlegroups.com?utm_medium=email_source=footer>.
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/148f20f481e5409a833ea043f771cbda%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie : Best data archive strategy

2018-06-12 Thread mickael . barbo
Thanks Matthew for your response.

I looked at Reversion. If I understand correctly what it did, it duplicate 
each transaction on internal database ?

Le mardi 12 juin 2018 20:01:02 UTC+2, Matthew Pava a écrit :
>
> I think what you’re really looking for is an audit log.  There are some 
> Django packages available that do that automatically.
>
>  
>
> You might find this one quite helpful, called Django Reversion:
>
> https://github.com/etianen/django-reversion
>
>  
>
>  
>
> *From:* django...@googlegroups.com  [mailto:
> django...@googlegroups.com ] *On Behalf Of *
> mickae...@gmail.com 
> *Sent:* Tuesday, June 12, 2018 12:22 PM
> *To:* Django users
> *Subject:* Newbie : Best data archive strategy
>
>  
>
> Hi,
>
> I'd like to archive some data.
>
> I came with this idea :
>
>
> class DataModel(models.Model):
>
> xxx
>
>
> class DataModelArchive(DataModel):
>
> pass
>
>  
>
>
> The DataModelArchive database created has only "a pointer" to DataModel.
>
> I saw a post indicating that I'll have to first create an 
> AbstractDataModel and inherit for it for both DataModelArchive and 
> DataModel.
>
> Well, what is the "best way" to archive data using Django ?
>
> Thx for your attention
>
> Micka
>
> -- 
> 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...@googlegroups.com .
> To post to this group, send email to djang...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/ef59e00a-3354-44f5-9c99-5ca85885026e%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/ef59e00a-3354-44f5-9c99-5ca85885026e%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/86e18583-0376-43f2-8419-b557459b5ca7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Newbie : Best data archive strategy

2018-06-12 Thread Matthew Pava
I think what you’re really looking for is an audit log.  There are some Django 
packages available that do that automatically.

You might find this one quite helpful, called Django Reversion:
https://github.com/etianen/django-reversion


From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of mickael.ba...@gmail.com
Sent: Tuesday, June 12, 2018 12:22 PM
To: Django users
Subject: Newbie : Best data archive strategy

Hi,

I'd like to archive some data.

I came with this idea :


class DataModel(models.Model):
xxx

class DataModelArchive(DataModel):
pass


The DataModelArchive database created has only "a pointer" to DataModel.

I saw a post indicating that I'll have to first create an AbstractDataModel and 
inherit for it for both DataModelArchive and DataModel.

Well, what is the "best way" to archive data using Django ?

Thx for your attention

Micka
--
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<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ef59e00a-3354-44f5-9c99-5ca85885026e%40googlegroups.com<https://groups.google.com/d/msgid/django-users/ef59e00a-3354-44f5-9c99-5ca85885026e%40googlegroups.com?utm_medium=email_source=footer>.
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7f06b4e05b3443ebbe20084a6c786a20%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Newbie : Best data archive strategy

2018-06-12 Thread mickael . barbo
Hi,

I'd like to archive some data.

I came with this idea :


class DataModel(models.Model):
xxx

class DataModelArchive(DataModel):
pass


The DataModelArchive database created has only "a pointer" to DataModel.

I saw a post indicating that I'll have to first create an AbstractDataModel 
and inherit for it for both DataModelArchive and DataModel.

Well, what is the "best way" to archive data using Django ?

Thx for your attention

Micka

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ef59e00a-3354-44f5-9c99-5ca85885026e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie - Microservice in Django - Best place to start learning

2018-02-02 Thread Paul Tiplady
Assuming you're trying to build a REST API and not a HTML website, you 
should look at http://www.django-rest-framework.org/ as it provides a lot 
of djangonic convenience methods for building REST APIs with the Django ORM.

On Thursday, February 1, 2018 at 9:16:47 AM UTC-8, pratibha sharma wrote:
>
> Hi,
>
> I have created 2 example websites in Django i.e. Voting and event booking 
> systems. 
> I want to learn to create microservice in Django. I took below example for 
> it.
>
> Service will 
> 1. take data from UI (it will send it in JSON format), 
> 2. store data in DB(MySQL)
> 3. Send Data to a device (in JSON format)
>
> My mind is flooded with questions like 
> how UI and service with communicate? 
> how can service communicate to device? etc.
>
> I am not sure where should I start and how to create the design for this 
> work. I am new in microservice and some experience in django.
>
> Please guide me.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ee24fd34-b612-4d79-8980-c79fbd4e54bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Newbie - Microservice in Django - Best place to start learning

2018-02-01 Thread pratibha sharma
Hi,

I have created 2 example websites in Django i.e. Voting and event booking 
systems. 
I want to learn to create microservice in Django. I took below example for 
it.

Service will 
1. take data from UI (it will send it in JSON format), 
2. store data in DB(MySQL)
3. Send Data to a device (in JSON format)

My mind is flooded with questions like 
how UI and service with communicate? 
how can service communicate to device? etc.

I am not sure where should I start and how to create the design for this 
work. I am new in microservice and some experience in django.

Please guide me.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/22b02827-8404-4218-9f49-a0117c4d2bc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie : Help for using RequestContext

2018-01-10 Thread mickael . barbo
Oh, 
*Thank you Andréas for your kind attention and your reactivity.*
Nice, I didn't know about request.session... And thanks to you, *now I Know* 
:-)

Just for archive, I found a way with context_processors here (old django 
version, but I adapt to django 2) :
http://apprendre-python.com/page-django-context-processor-template

Very happy to join Django community :D

Micka

Le mercredi 10 janvier 2018 09:36:46 UTC+1, Andréas Kühne a écrit :
>
> Hi Micka,
>
> And welcome to django.
>
> Regarding how to add things in middleware - you can add the information to 
> the session like this:
>
> class SimpleBreadcrumbs(object):
> def __init__(self, get_response):
> self.get_response = get_response
> # One-time configuration and initialization.
>
>
> def __call__(self, request):
> # Code to be executed for each request before
> # the view (and later middleware) are called.
>
> request.session['breadcrumbs'] = {"level0": "Adrian", "level1": 
> "Thomas"}
>
> response = self.get_response(request)
>
>
> # Code to be executed for each request/response after
> # the view is called.
>
> return response
>
>
> Then in your templates you can do this:
>
> {% extends 'pricing/body.html' %}
>
> {% block content %}
>
> {{ breadcrumbs.level0 }} / {{ breadcrumbs.level1 }}
>
> {% endblock content %}
>
> Regards,
>
> Andréas
>
> 2018-01-10 0:42 GMT+01:00 <mickae...@gmail.com >:
>
>> Hello to all Django users :-)
>>
>> I'm new to Django and this is my first post.
>>
>> I'd like to implement breadcrumbs on all my pages.
>>
>> My strategy is to create a middleware and to use RequestContext to
>> add a dict to the context of each request then use the context in my html
>>
>> My problem is that I don't understand how to link RequestContext to 
>> my request. Hereafter my code :
>>
>> my_middleware.py
>> from django.template import RequestContext
>>
>>
>> class SimpleBreadcrumbs(object):
>> def __init__(self, get_response):
>> self.get_response = get_response
>> # One-time configuration and initialization.
>>
>>
>> def __call__(self, request):
>> # Code to be executed for each request before
>> # the view (and later middleware) are called.
>>
>> request_context = RequestContext(request)
>> request_context.push({"level0": "Adrian", "level1": "Thomas"})
>>
>> response = self.get_response(request)
>>
>>
>> # Code to be executed for each request/response after
>> # the view is called.
>>
>> return response
>>
>>
>> my_template.html
>>
>> {% extends 'pricing/body.html' %}
>>
>> {% block content %}
>>
>> {{ level0 }}
>>
>> {% endblock content %}
>>
>>
>> What I'm doing wrong ?
>>
>> Thx for your help
>>
>> Micka
>> Django newbie
>> ;-)
>>
>>
>>
>>
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/6cf0e65a-2b48-4bbb-a8a7-0351252e49f9%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/6cf0e65a-2b48-4bbb-a8a7-0351252e49f9%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e6de4d19-7778-4988-abbf-3906a134bc42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie : Help for using RequestContext

2018-01-10 Thread Andréas Kühne
Hi Micka,

And welcome to django.

Regarding how to add things in middleware - you can add the information to
the session like this:

class SimpleBreadcrumbs(object):
def __init__(self, get_response):
self.get_response = get_response
# One-time configuration and initialization.


def __call__(self, request):
# Code to be executed for each request before
# the view (and later middleware) are called.

request.session['breadcrumbs'] = {"level0": "Adrian", "level1":
"Thomas"}

response = self.get_response(request)


# Code to be executed for each request/response after
# the view is called.

return response


Then in your templates you can do this:

{% extends 'pricing/body.html' %}

{% block content %}

{{ breadcrumbs.level0 }} / {{ breadcrumbs.level1 }}

{% endblock content %}

Regards,

Andréas

2018-01-10 0:42 GMT+01:00 <mickael.ba...@gmail.com>:

> Hello to all Django users :-)
>
> I'm new to Django and this is my first post.
>
> I'd like to implement breadcrumbs on all my pages.
>
> My strategy is to create a middleware and to use RequestContext to
> add a dict to the context of each request then use the context in my html
>
> My problem is that I don't understand how to link RequestContext to
> my request. Hereafter my code :
>
> my_middleware.py
> from django.template import RequestContext
>
>
> class SimpleBreadcrumbs(object):
> def __init__(self, get_response):
> self.get_response = get_response
> # One-time configuration and initialization.
>
>
> def __call__(self, request):
> # Code to be executed for each request before
> # the view (and later middleware) are called.
>
> request_context = RequestContext(request)
> request_context.push({"level0": "Adrian", "level1": "Thomas"})
>
> response = self.get_response(request)
>
>
> # Code to be executed for each request/response after
> # the view is called.
>
> return response
>
>
> my_template.html
>
> {% extends 'pricing/body.html' %}
>
> {% block content %}
>
> {{ level0 }}
>
> {% endblock content %}
>
>
> What I'm doing wrong ?
>
> Thx for your help
>
> Micka
> Django newbie
> ;-)
>
>
>
>
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/6cf0e65a-2b48-4bbb-a8a7-0351252e49f9%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/6cf0e65a-2b48-4bbb-a8a7-0351252e49f9%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCem5X%2B4ess5bexkej_fs_TmG1vHMbxOzJco5bzU-sQyZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Newbie : Help for using RequestContext

2018-01-09 Thread Mickael . barbo
Hello to all Django users :-)

I'm new to Django and this is my first post.

I'd like to implement breadcrumbs on all my pages.

My strategy is to create a middleware and to use RequestContext to
add a dict to the context of each request then use the context in my html

My problem is that I don't understand how to link RequestContext to 
my request. Hereafter my code :

my_middleware.py
from django.template import RequestContext


class SimpleBreadcrumbs(object):
def __init__(self, get_response):
self.get_response = get_response
# One-time configuration and initialization.


def __call__(self, request):
# Code to be executed for each request before
# the view (and later middleware) are called.

request_context = RequestContext(request)
request_context.push({"level0": "Adrian", "level1": "Thomas"})

response = self.get_response(request)


# Code to be executed for each request/response after
# the view is called.

return response


my_template.html

{% extends 'pricing/body.html' %}

{% block content %}

{{ level0 }}

{% endblock content %}


What I'm doing wrong ?

Thx for your help

Micka
Django newbie
;-)





-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6cf0e65a-2b48-4bbb-a8a7-0351252e49f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Some newbie questions on CBVs and FBVs

2017-11-24 Thread 'Simon Connah' via Django users
 Hi,
First of all thank you very much for the reply. It was very useful. I'll 
re-read the documentation and see what I was missing out on.
The get_queryset() method was a very useful hint. That may well solve the issue 
I was having.
Simon.On Friday, 24 November 2017, 06:20:35 GMT, Matemática A3K 
<matematica@gmail.com> wrote:  
 
 

On Thu, Nov 23, 2017 at 8:49 PM, 'Simon Connah' via Django users 
<django-users@googlegroups.com> wrote:

Hi everyone,
First of all sorry for the newbie questions it has been a long time since I 
used Django and I think I have forgotten just about everything I once knew.
I'm working on a user app for a website. I can't use the built in user model as 
I need a little more flexibility and the ability to grow in the future if 
required.
Basically I have three problems.
1) I need some views to be limited to the user who created the view.

Users do no create Views, what you are meaning is the objects "created" by the 
user (or objects attributed or associated to the user if you want to be even 
more precise)
 
 For instance I have an UpdateUser view and I only want the currently logged in 
user to be able to change their own user model data. So say I have the username 
"djangouser" and I go to UpdateView the only row in the database that I can 
change on the database server is the one with the username "djangouser". I'm 
not sure what the best way to handle this problem is?

Set the queryset attribute of the UpdateView to 
User.objects.filter(name=self.request.user) or override the get_queryset() 
method in the view:def get_queryset(self):
base_qs = super(YourUpdateView, self).get_queryset()
return 
base_qs.filter(user=self.request.user)https://stackoverflow.com/questions/8594759/django-updateview-restrict-per-user
https://docs.djangoproject.com/en/1.11/ref/class-based-views/mixins-single-object/#django.views.generic.detail.SingleObjectMixin.get_queryset


I could do it manually in a function based view without any problem but I find 
CBVs to be really hard to customise when you want to do something that they 
were not specifically designed to do.

Overriding the queryset is a common pattern in CBV :)
 
 At that point I just end up writing a FBV instead and doing it all myself as 
it is quicker than trying to figure out all the mixins and all the methods of 
the class.


I must be missing something simple with CBVs. Any help would be appreciated 
with this :).
 You should read the whole topic:
https://docs.djangoproject.com/en/1.11/topics/class-based-views/intro/ 
and then read the 
reference:https://docs.djangoproject.com/en/1.11/ref/class-based-views/mixins/


2) In FBVs you get passed a variable to the function with the URL conf 
variables, for instance: (path('/blah//', view, name='blah') would 
result in the FBV recieving a username parameter. Where are these variables 
stored when using a CBV?

You should read the topic :)
 

3) Is it considered bad practice to use FBVs in Django?

IMO, no :)
 
 I just find them so much easier and quicker to write. I know that CBVs result 
in less code duplication but I find I constantly need the Django docs open to 
see what each CBV supports and which methods it has available. Where as with 
FBVs I just write the code and everything works.


CBV is a pattern, if you don't embrace it, it may get in your way :)
 
Anyway, thank you for any help :).
Simon.

-- 
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+unsubscribe@ googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/ group/django-users.
To view this discussion on the web visit https://groups.google.com/d/ 
msgid/django-users/1609714478. 2477254.1511480996285%40mail. yahoo.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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BFDnh%2BYZfaoRPAvZCeGr3L2uz6W%3DTgcVChAwJV%3DCmhC4Y9%2BQA%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 https://groups.google.com/group/django-user

Re: Some newbie questions on CBVs and FBVs

2017-11-23 Thread Matemática A3K
On Thu, Nov 23, 2017 at 8:49 PM, 'Simon Connah' via Django users <
django-users@googlegroups.com> wrote:

> Hi everyone,
>
> First of all sorry for the newbie questions it has been a long time since
> I used Django and I think I have forgotten just about everything I once
> knew.
>
> I'm working on a user app for a website. I can't use the built in user
> model as I need a little more flexibility and the ability to grow in the
> future if required.
>
> Basically I have three problems.
>
> 1) I need some views to be limited to the user who created the view.
>

Users do no create Views, what you are meaning is the objects "created" by
the user (or objects attributed or associated to the user if you want to be
even more precise)


> For instance I have an UpdateUser view and I only want the currently
> logged in user to be able to change their own user model data. So say I
> have the username "djangouser" and I go to UpdateView the only row in the
> database that I can change on the database server is the one with the
> username "djangouser". I'm not sure what the best way to handle this
> problem is?
>

Set the queryset attribute of the UpdateView to
User.objects.filter(name=self.request.user) or override the get_queryset()
method in the view:

def get_queryset(self):
base_qs = super(YourUpdateView, self).get_queryset()
return base_qs.filter(user=self.request.user)

https://stackoverflow.com/questions/8594759/django-updateview-restrict-per-user

https://docs.djangoproject.com/en/1.11/ref/class-based-views/mixins-single-object/#django.views.generic.detail.SingleObjectMixin.get_queryset

>
> I could do it manually in a function based view without any problem but I
> find CBVs to be really hard to customise when you want to do something that
> they were not specifically designed to do.
>

Overriding the queryset is a common pattern in CBV :)


> At that point I just end up writing a FBV instead and doing it all myself
> as it is quicker than trying to figure out all the mixins and all the
> methods of the class.
>

> I must be missing something simple with CBVs. Any help would be
> appreciated with this :).
>

You should read the whole topic:
https://docs.djangoproject.com/en/1.11/topics/class-based-views/intro/
and then read the reference:
https://docs.djangoproject.com/en/1.11/ref/class-based-views/mixins/

>
> 2) In FBVs you get passed a variable to the function with the URL conf
> variables, for instance: (path('/blah//', view, name='blah')
> would result in the FBV recieving a username parameter. Where are these
> variables stored when using a CBV?
>

You should read the topic :)


>
> 3) Is it considered bad practice to use FBVs in Django?
>

IMO, no :)


> I just find them so much easier and quicker to write. I know that CBVs
> result in less code duplication but I find I constantly need the Django
> docs open to see what each CBV supports and which methods it has available.
> Where as with FBVs I just write the code and everything works.
>
>
CBV is a pattern, if you don't embrace it, it may get in your way :)


> Anyway, thank you for any help :).
>
> Simon.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/1609714478.2477254.1511480996285%40mail.yahoo.com
> <https://groups.google.com/d/msgid/django-users/1609714478.2477254.1511480996285%40mail.yahoo.com?utm_medium=email_source=footer>
> .
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BFDnh%2BYZfaoRPAvZCeGr3L2uz6W%3DTgcVChAwJV%3DCmhC4Y9%2BQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Some newbie questions on CBVs and FBVs

2017-11-23 Thread 'Simon Connah' via Django users
Hi everyone,
First of all sorry for the newbie questions it has been a long time since I 
used Django and I think I have forgotten just about everything I once knew.
I'm working on a user app for a website. I can't use the built in user model as 
I need a little more flexibility and the ability to grow in the future if 
required.
Basically I have three problems.
1) I need some views to be limited to the user who created the view. For 
instance I have an UpdateUser view and I only want the currently logged in user 
to be able to change their own user model data. So say I have the username 
"djangouser" and I go to UpdateView the only row in the database that I can 
change on the database server is the one with the username "djangouser". I'm 
not sure what the best way to handle this problem is?
I could do it manually in a function based view without any problem but I find 
CBVs to be really hard to customise when you want to do something that they 
were not specifically designed to do. At that point I just end up writing a FBV 
instead and doing it all myself as it is quicker than trying to figure out all 
the mixins and all the methods of the class.
I must be missing something simple with CBVs. Any help would be appreciated 
with this :).
2) In FBVs you get passed a variable to the function with the URL conf 
variables, for instance: (path('/blah//', view, name='blah') would 
result in the FBV recieving a username parameter. Where are these variables 
stored when using a CBV?
3) Is it considered bad practice to use FBVs in Django? I just find them so 
much easier and quicker to write. I know that CBVs result in less code 
duplication but I find I constantly need the Django docs open to see what each 
CBV supports and which methods it has available. Where as with FBVs I just 
write the code and everything works.
Anyway, thank you for any help :).
Simon.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1609714478.2477254.1511480996285%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python / Django newbie looking for mentorship

2017-03-20 Thread Feria Científica
Thanks   a lot, I´ll start by the second,   greetings!

Richard

On Mon, Mar 20, 2017 at 2:03 AM, Mark Phillips <m...@phillipsmarketing.biz>
wrote:

> Feria,
>
> Start here if you are comfortable with Pythonhttps://docs.
> djangoproject.com/en/1.10/intro/tutorial01/
>
> Start here if you are new to Python...https://www.
> codecademy.com/learn/python
>
> Both are hands on.
>
> Good luck!
>
> Mark
>
> On Sun, Mar 19, 2017 at 6:52 PM, Feria Científica <
> laferiacientif...@gmail.com> wrote:
>
>> I am a second year student of Electrical Engineering. I am a little bit
>> lost on where to start with Django/Python. I´d like to run programs to see
>> functions in action.  Where can I see codes??  Thanks
>>
>> Richard
>>
>> On Sun, Mar 19, 2017 at 7:12 PM, propellerhat <the.propeller...@gmail.com
>> > wrote:
>>
>>> If you have 20 Years of experience as a software developer you can
>>> easily learn python by yourself in one or two weeks.
>>>
>>> There is a nice tutorial on the official Python website:
>>>
>>> > https://docs.python.org/3.6/tutorial/introduction.html
>>>
>>> You can ask beginner questions on the Python Tutor mailing list:
>>>
>>> > https://mail.python.org/mailman/listinfo/tutor
>>>
>>> For learning the Django framework, I can't really comment on it, because
>>> I'm a newbie myself. However I'm not planning to hire anybody to each me.
>>>
>>> --
>>> 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 https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-users/9d6b653e-0dc9-44c7-8c33-3cef42b77484%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/9d6b653e-0dc9-44c7-8c33-3cef42b77484%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/CALxdnWbzZ05Y2JYcp3M5Ds4Q6YEcMzLG2-
>> TWnPFuFPiK2RH82A%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CALxdnWbzZ05Y2JYcp3M5Ds4Q6YEcMzLG2-TWnPFuFPiK2RH82A%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAEqej2Mdtg7ezdCF%3D4_tgiFjoF%
> 3DwW%3DnK7PAZnd9-UA9cispmow%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAEqej2Mdtg7ezdCF%3D4_tgiFjoF%3DwW%3DnK7PAZnd9-UA9cispmow%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALxdnWZ3n%2B%3DtMcr%3Dr5gNbxviTSkg%3DPkVqsJee32DNFb6LZ9D0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python / Django newbie looking for mentorship

2017-03-20 Thread Antonis Christofides
> If you have 20 Years of experience as a software developer you can easily
> learn python by yourself in one or two weeks.

Of course he can. However a teacher is a huge boon, for various reasons, and if
you have a little more money than time it's really a good idea to get one.

If someone is experienced in C or Delphi, for example, their first Python code
looks like this:

for i in range(alist):

do_something(alist[i])


Unlearning the C idioms and learning the Python ones is much faster and much
easier with a teacher.

Regards,

A.

Antonis Christofides
http://djangodeployment.com


On 03/20/2017 12:12 AM, propellerhat wrote:
> If you have 20 Years of experience as a software developer you can easily
> learn python by yourself in one or two weeks.
>
> There is a nice tutorial on the official Python website:
>
> > https://docs.python.org/3.6/tutorial/introduction.html
>
> You can ask beginner questions on the Python Tutor mailing list:
>
> > https://mail.python.org/mailman/listinfo/tutor
>
> For learning the Django framework, I can't really comment on it, because I'm a
> newbie myself. However I'm not planning to hire anybody to each me.
> -- 
> 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
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9d6b653e-0dc9-44c7-8c33-3cef42b77484%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/9d6b653e-0dc9-44c7-8c33-3cef42b77484%40googlegroups.com?utm_medium=email_source=footer>.
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d1ba416e-6232-8f6e-ccb5-fa6cd03849d0%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python / Django newbie looking for mentorship

2017-03-19 Thread Mark Phillips
Feria,

Start here if you are comfortable with Python
https://docs.djangoproject.com/en/1.10/intro/tutorial01/

Start here if you are new to Python...
https://www.codecademy.com/learn/python

Both are hands on.

Good luck!

Mark

On Sun, Mar 19, 2017 at 6:52 PM, Feria Científica <
laferiacientif...@gmail.com> wrote:

> I am a second year student of Electrical Engineering. I am a little bit
> lost on where to start with Django/Python. I´d like to run programs to see
> functions in action.  Where can I see codes??  Thanks
>
> Richard
>
> On Sun, Mar 19, 2017 at 7:12 PM, propellerhat <the.propeller...@gmail.com>
> wrote:
>
>> If you have 20 Years of experience as a software developer you can easily
>> learn python by yourself in one or two weeks.
>>
>> There is a nice tutorial on the official Python website:
>>
>> > https://docs.python.org/3.6/tutorial/introduction.html
>>
>> You can ask beginner questions on the Python Tutor mailing list:
>>
>> > https://mail.python.org/mailman/listinfo/tutor
>>
>> For learning the Django framework, I can't really comment on it, because
>> I'm a newbie myself. However I'm not planning to hire anybody to each me.
>>
>> --
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/9d6b653e-0dc9-44c7-8c33-3cef42b77484%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/9d6b653e-0dc9-44c7-8c33-3cef42b77484%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CALxdnWbzZ05Y2JYcp3M5Ds4Q6YEcM
> zLG2-TWnPFuFPiK2RH82A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CALxdnWbzZ05Y2JYcp3M5Ds4Q6YEcMzLG2-TWnPFuFPiK2RH82A%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEqej2Mdtg7ezdCF%3D4_tgiFjoF%3DwW%3DnK7PAZnd9-UA9cispmow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python / Django newbie looking for mentorship

2017-03-19 Thread Feria Científica
I am a second year student of Electrical Engineering. I am a little bit
lost on where to start with Django/Python. I´d like to run programs to see
functions in action.  Where can I see codes??  Thanks

Richard

On Sun, Mar 19, 2017 at 7:12 PM, propellerhat <the.propeller...@gmail.com>
wrote:

> If you have 20 Years of experience as a software developer you can easily
> learn python by yourself in one or two weeks.
>
> There is a nice tutorial on the official Python website:
>
> > https://docs.python.org/3.6/tutorial/introduction.html
>
> You can ask beginner questions on the Python Tutor mailing list:
>
> > https://mail.python.org/mailman/listinfo/tutor
>
> For learning the Django framework, I can't really comment on it, because
> I'm a newbie myself. However I'm not planning to hire anybody to each me.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/9d6b653e-0dc9-44c7-8c33-3cef42b77484%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/9d6b653e-0dc9-44c7-8c33-3cef42b77484%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALxdnWbzZ05Y2JYcp3M5Ds4Q6YEcMzLG2-TWnPFuFPiK2RH82A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python / Django newbie looking for mentorship

2017-03-19 Thread propellerhat
If you have 20 Years of experience as a software developer you can easily 
learn python by yourself in one or two weeks. 

There is a nice tutorial on the official Python website:

> https://docs.python.org/3.6/tutorial/introduction.html

You can ask beginner questions on the Python Tutor mailing list:

> https://mail.python.org/mailman/listinfo/tutor

For learning the Django framework, I can't really comment on it, because 
I'm a newbie myself. However I'm not planning to hire anybody to each me.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9d6b653e-0dc9-44c7-8c33-3cef42b77484%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Python / Django newbie looking for mentorship

2017-03-19 Thread Jon Hickam
I have 20 years experience in software but am new to OO python and django, 
 I have a project I am tackling and would be most grateful if there is 
someone I could hire to clone my repo and give me advice as I navigate my 
first project, maybe once or twice a week at the beginning?  Schedule can 
be flexible.  If you are interested send me a quick note with what your 
experience is and what sort of compensation rate you would be looking for 
and we can work out a time to chat. 
Cheers!
Jon


 

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d34aab02-afc1-4758-a57a-0a5f0062b1ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question, start server with hostname

2017-02-08 Thread Dylan Reinhold
You don't include the http://
python manage.py runserver hostname:8000 or put the IP address in the
hostname area/

Dylan

On Wed, Feb 8, 2017 at 12:29 PM, hippohippo 
wrote:

> Dear all,
>
> I am a new comer on Django. I was able to to run start server by command
> as below yesterday.
>
> python manage.py runserver http:/hostname:8000
>
> However today, it submit the error as CommandError: "
> http://te172.24.221.137:8000/; is not a valid port number or address:port
> pair.
>
> Can anyone give me some hint how to fix this? 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/c029b611-898b-4015-b643-e1eaabaa43cc%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHtg44DExi7rq-NkBgjaC6ZMXMc0VFBvNiXuj6GB7R0ynHztqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Newbie question, start server with hostname

2017-02-08 Thread hippohippo
Dear all,

I am a new comer on Django. I was able to to run start server by command as 
below yesterday.

python manage.py runserver http:/hostname:8000 

However today, it submit the error as CommandError: 
"http://te172.24.221.137:8000/; is not a valid port number or address:port 
pair.

Can anyone give me some hint how to fix this? 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c029b611-898b-4015-b643-e1eaabaa43cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question - data structure for game

2016-10-30 Thread Derek
You'll probably need jQuery. Bear in mind "size" is not absolute as it will 
depend on font family and font height.

On Sunday, 30 October 2016 01:27:59 UTC+2, Ken Albright wrote:
>
> Sounds good. Thanks for the advice. Now if I could only figure out how to 
> get forms to expand and contract to match the size of the quote...
>
> Thanks.
>
> On Friday, October 28, 2016 at 5:00:14 PM UTC-7, Ken Albright wrote:
>>
>> I'm just learning Python and Django so please be gentle...
>>
>> I've written a quote decryption game (like you see in the newspaper) in 
>> Python. I'd like to put it on a web page with Django. However, I'm not sure 
>> of the best way to structure the data. The original quote and the encrypted 
>> quote need to have a one-to-one relationship at the letter level. So it 
>> could be two strings on the same row (same id) or a set of tuples, a 
>> dictionary, or ???
>>
>> How to set up the database and models.py?
>>
>> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/600aea7e-54fc-4856-9c71-fc56469d3712%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question - data structure for game

2016-10-29 Thread Stephanie Statsmann
K

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fd2efe41-c1dc-455d-9597-a931186c6382%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question - data structure for game

2016-10-29 Thread Ken Albright
Sounds good. Thanks for the advice. Now if I could only figure out how to 
get forms to expand and contract to match the size of the quote...

Thanks.

On Friday, October 28, 2016 at 5:00:14 PM UTC-7, Ken Albright wrote:
>
> I'm just learning Python and Django so please be gentle...
>
> I've written a quote decryption game (like you see in the newspaper) in 
> Python. I'd like to put it on a web page with Django. However, I'm not sure 
> of the best way to structure the data. The original quote and the encrypted 
> quote need to have a one-to-one relationship at the letter level. So it 
> could be two strings on the same row (same id) or a set of tuples, a 
> dictionary, or ???
>
> How to set up the database and models.py?
>
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d97d972b-ec64-483a-8aaf-e69482a4050e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question - data structure for game

2016-10-29 Thread Yaşar Arabacı
I am also quite new to django, but I will go with something like this;

class Quote(models.Model):
quote= models.CharField(max_length=100)

class EncryptedQuote(models.Model)
quote = models.ForeignKey(Quote, on_delete=models.CASCADE)
encrypted_quote = models.CharField(max_length=100)


So, you can have multiple encryptions of any quote.

On Saturday, October 29, 2016 at 3:00:14 AM UTC+3, Ken Albright wrote:
>
> I'm just learning Python and Django so please be gentle...
>
> I've written a quote decryption game (like you see in the newspaper) in 
> Python. I'd like to put it on a web page with Django. However, I'm not sure 
> of the best way to structure the data. The original quote and the encrypted 
> quote need to have a one-to-one relationship at the letter level. So it 
> could be two strings on the same row (same id) or a set of tuples, a 
> dictionary, or ???
>
> How to set up the database and models.py?
>
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dc31d02e-8345-4467-99df-0e4688a76a48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question - data structure for game

2016-10-29 Thread Bob Gailer
On Oct 28, 2016 7:59 PM, "Ken Albright"  wrote:
>
> I'm just learning Python and Django so please be gentle...
>
> I've written a quote decryption game (like you see in the newspaper) in
Python. I'd like to put it on a web page with Django. However, I'm not sure
of the best way to structure the data. The original quote and the encrypted
quote need to have a one-to-one relationship at the letter level. So it
could be two strings on the same row (same id)

That is the simplest, and I see no need for anything more complex.

or a set of tuples, a dictionary, or ???
>
> How to set up the database

What do you mean?

and models.py?

class Quote:
plain= Models.CharField()
crypt = Models.CharField()

> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/b37833bf-e474-4b15-844d-4ef8d8e854b6%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP1rxO7uhPGRD8MdDaZxPM9ZWpViMMoFdy0_dBfb5ahuZiEB4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Newbie question - data structure for game

2016-10-28 Thread Ken Albright
I'm just learning Python and Django so please be gentle...

I've written a quote decryption game (like you see in the newspaper) in 
Python. I'd like to put it on a web page with Django. However, I'm not sure 
of the best way to structure the data. The original quote and the encrypted 
quote need to have a one-to-one relationship at the letter level. So it 
could be two strings on the same row (same id) or a set of tuples, a 
dictionary, or ???

How to set up the database and models.py?

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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b37833bf-e474-4b15-844d-4ef8d8e854b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie to Novice – Using Admin DateTime Picker in your Form

2016-09-19 Thread Mayank Rungta
I am looking at making custom forms look like Django admin forms with the
widgets in place. Also, I like to do a similar thing for displaying tables.
I used a combination of plugins for sorting, filters and displaying tables
with pagination. The result was not as good. What I am hoping is to find an
easy way to reuse the features already available with django admin. But it
appears this approach is not recommended and I saw a post by a django
maintainer saying it is not likely to make this any easier in near future.
Would have been nice to have this in place, as there are a plethora of
plugins in Django & Java Script out there and sifting through them is
difficult for a newbie like me.

Looking for suitable inputs on this forum.

Thanks in advance,
mynk

On Mon, Sep 19, 2016 at 8:04 PM, Nate Granatir <nategrana...@gmail.com>
wrote:

> Just realized this thread was not necessarily about filters for the admin;
> in the case of using custom forms/views Django daterange filter may not be
> a good option.
>
>
> On Thursday, March 19, 2009 at 8:37:56 AM UTC-5, Paul Nema wrote:
>>
>> I've noticed many people new to Django (and sometimes also new to Python)
>> often post the same/similar questions in various forums. How to I get
>> something to work and/or do you have an example for X. As I've also
>> experienced this problem I've decided to post my little solution. Its not
>> the only way to do this, just the way I did it. Hopefully this will provide
>> the answer people are searching for or at least get them started. I guess
>> it will also serve as a quick code review by those so inclined to comment.
>>
>>
>> You've probably heard of DRY but I think something is missing. There
>> should also be a Don't Repeat Other's Work (DROW) when they already solved
>> the problem. Thus another motivation to post this.  On a side note there is
>> a bit of debate out there about using the Django AdminDateWidget verse
>> other solutions (Jquery, etc). Your decision to make but why increase
>> dependencies when you don't have to.
>>
>>
>> As I'm still learning Django everything in the code below may not be
>> required but I'm listing it anyway. You may need to modify to your
>> particular environment.  As I don't have a blog to post this I'm sending it
>> to this group. I'm open to any suggestions for a better place to post this.
>>
>>
>> For this example I will focus on adding a date picker for date of birth
>> (dob) and a date time picker for sponsor sign date (sponsor_sign_date). Key
>> items are in *Bold*.
>>
>>
>> Another reference to adding the AdminDateTime widget is here:
>> http://stackoverflow.com/questions/38601/using-django-time-
>> date-widgets-in-custom-form
>>
>>
>>
>>
>> ---
>>
>> My top level (django-admin.py startproject izbo) directory Structure:
>>
>> mylogin@LX-D620:~/dev/izbo$ ll
>>
>> drwxrwxr-x 2 mylogin mylogin 4096 2009-03-17 10:52 account/
>>
>> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:53 add/
>>
>> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-18 04:34 adjudicator/
>>
>> drwxrwxr-x 2 mylogin mylogin 4096 2009-03-18 09:43 application/
>>
>> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-18 10:06 contract/
>>
>> drwxrwxrwx 2 mylogin mylogin 4096 2009-03-18 09:49 DB/
>>
>> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:51 employer/
>>
>> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-18 04:34 entity/
>>
>> -rw-r--r-- 1 mylogin mylogin 207 2009-03-08 04:54 exclude
>>
>> drwxrwxrwx 2 mylogin mylogin 4096 2009-03-18 10:06 gzbo/
>>
>> -rw-r--r-- 1 mylogin mylogin 0 2009-01-06 04:55 __init__.py
>>
>> -rw-r--r-- 1 mylogin mylogin 546 2009-01-06 04:55 manage.py
>>
>> drwxrwxrwx 5 mylogin mylogin 4096 2009-02-08 12:35 media/
>>
>> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:53 member/
>>
>> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:52 note/
>>
>> drwxr-xr-x 2 mylogin mylogin 4096 2009-02-20 12:47 search/
>>
>> -rw-r--r-- 1 mylogin mylogin 4192 2009-03-05 23:39 settings.py
>>
>> drwxrwxrwx12 mylogin mylogin 4096 2009-03-16 11:48 templates/
>>
>> -rw-r--r-- 1 mylogin mylogin 2118 2009-03-16 11:16 urls.py
>>
>>
>> --
>>
>> Media directory Listing:
>>
>> mylogin@LX-D620:~/dev/izbo/media$ ll
>>
>> total 12
>>
>> drwxr-xr-x 5 mylogin mylogin 4096 2009-03-18 10:56 admin/
>>
>> drwxrwxrwx 2 mylogin mylogin 4096 2009-02-07 15:45 css/
>>
>> drwxrwxrwx 2 mylogin mylogin 4096 2009-01-27 10:07 images/

Re: Newbie to Novice – Using Admin DateTime Picker in your Form

2016-09-19 Thread Nate Granatir
Just realized this thread was not necessarily about filters for the admin; 
in the case of using custom forms/views Django daterange filter may not be 
a good option.

On Thursday, March 19, 2009 at 8:37:56 AM UTC-5, Paul Nema wrote:
>
> I've noticed many people new to Django (and sometimes also new to Python) 
> often post the same/similar questions in various forums. How to I get 
> something to work and/or do you have an example for X. As I've also 
> experienced this problem I've decided to post my little solution. Its not 
> the only way to do this, just the way I did it. Hopefully this will provide 
> the answer people are searching for or at least get them started. I guess 
> it will also serve as a quick code review by those so inclined to comment.
>
>
> You've probably heard of DRY but I think something is missing. There 
> should also be a Don't Repeat Other's Work (DROW) when they already solved 
> the problem. Thus another motivation to post this.  On a side note there is 
> a bit of debate out there about using the Django AdminDateWidget verse 
> other solutions (Jquery, etc). Your decision to make but why increase 
> dependencies when you don't have to.
>
>
> As I'm still learning Django everything in the code below may not be 
> required but I'm listing it anyway. You may need to modify to your 
> particular environment.  As I don't have a blog to post this I'm sending it 
> to this group. I'm open to any suggestions for a better place to post this.
>
>
> For this example I will focus on adding a date picker for date of birth 
> (dob) and a date time picker for sponsor sign date (sponsor_sign_date). Key 
> items are in *Bold*.
>
>
> Another reference to adding the AdminDateTime widget is here: 
> http://stackoverflow.com/questions/38601/using-django-time-date-widgets-in-custom-form
>
>
>
>
> ---
>
> My top level (django-admin.py startproject izbo) directory Structure:
>
> mylogin@LX-D620:~/dev/izbo$ ll
>
> drwxrwxr-x 2 mylogin mylogin 4096 2009-03-17 10:52 account/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:53 add/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-18 04:34 adjudicator/ 
>
> drwxrwxr-x 2 mylogin mylogin 4096 2009-03-18 09:43 application/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-18 10:06 contract/ 
>
> drwxrwxrwx 2 mylogin mylogin 4096 2009-03-18 09:49 DB/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:51 employer/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-18 04:34 entity/ 
>
> -rw-r--r-- 1 mylogin mylogin 207 2009-03-08 04:54 exclude 
>
> drwxrwxrwx 2 mylogin mylogin 4096 2009-03-18 10:06 gzbo/ 
>
> -rw-r--r-- 1 mylogin mylogin 0 2009-01-06 04:55 __init__.py 
>
> -rw-r--r-- 1 mylogin mylogin 546 2009-01-06 04:55 manage.py 
>
> drwxrwxrwx 5 mylogin mylogin 4096 2009-02-08 12:35 media/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:53 member/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:52 note/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-02-20 12:47 search/ 
>
> -rw-r--r-- 1 mylogin mylogin 4192 2009-03-05 23:39 settings.py 
>
> drwxrwxrwx12 mylogin mylogin 4096 2009-03-16 11:48 templates/ 
>
> -rw-r--r-- 1 mylogin mylogin 2118 2009-03-16 11:16 urls.py 
>
>
> --
>
> Media directory Listing:
>
> mylogin@LX-D620:~/dev/izbo/media$ ll 
>
> total 12 
>
> drwxr-xr-x 5 mylogin mylogin 4096 2009-03-18 10:56 admin/ 
>
> drwxrwxrwx 2 mylogin mylogin 4096 2009-02-07 15:45 css/ 
>
> drwxrwxrwx 2 mylogin mylogin 4096 2009-01-27 10:07 images/ 
>
> lrwxrwxrwx 1 mylogin mylogin 36 2009-03-18 11:07 img -> 
> /home/mylogin/dev/izbo/media/admin/img/ 
>
>
> * Note: admin/ is 'cp -r' of directory 
> /usr/lib/python2.5/site-packages/django/contrib/admin/media.  Then I linked 
> the img directory.
>
>
>
> 
>
> In my “settings.py”
>
>
> import os.path 
>
> PROJECT_DIR = os.path.dirname(__file__) 
>
>
> MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media') 
>
> MEDIA_URL = 'http://www.izbo.com/media/'
>
> *ADMIN_MEDIA_PREFIX = '/media/admin/'*
>
> TEMPLATE_DIRS = ( 
>
>os.path.join(PROJECT_DIR, 'templates'),
>
>...
>
> )
>
>
> 
>
> In my top level “urls.py” file
>
> *from django.contrib import admin * 
>
>
> urlpatterns = patterns('', 
>
># Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
>
># to INSTALLED_APPS to enable admin documentation: 
>
>(r'^admin/doc/', include('django.contrib.admindocs.urls')), 
>
>
>*# Add this to get widgets.AdminDateWidget() working for non is_staff, 
> is_superuser * 
>
>*# This must be placed before (r'^admin/(.*)', admin.site.root), as 
> that gobals up everything * 
>
>*(r'^admin/jsi18n/$', 'django.views.i18n.javascript_catalog'), * 
>
>
># Uncomment the next line to enable the admin: 
>
>(r'^admin/(.*)', admin.site.root), 
>
>
># IZBO related URLs 
>
>(r'^$', splash), 
>
>.
>
> )
>
>
>
> -
>
> In “gzbo/models.py” I have my class
>
>
> # 
>
> # Application 
>
> # 
>
> class App (Record) : 
>
> # 

Re: Newbie to Novice – Using Admin DateTime Picker in your Form

2016-09-19 Thread Nate Granatir
I just installed Django Daterange Filter 1.3.0 
(https://github.com/DXist/django-daterange-filter) on a Django 1.9 project. 
Took a little CSS fiddling to get it to display properly with Grappelli, 
but other than that it worked like a charm.

Nate


On Thursday, March 19, 2009 at 8:37:56 AM UTC-5, Paul Nema wrote:
>
> I've noticed many people new to Django (and sometimes also new to Python) 
> often post the same/similar questions in various forums. How to I get 
> something to work and/or do you have an example for X. As I've also 
> experienced this problem I've decided to post my little solution. Its not 
> the only way to do this, just the way I did it. Hopefully this will provide 
> the answer people are searching for or at least get them started. I guess 
> it will also serve as a quick code review by those so inclined to comment.
>
>
> You've probably heard of DRY but I think something is missing. There 
> should also be a Don't Repeat Other's Work (DROW) when they already solved 
> the problem. Thus another motivation to post this.  On a side note there is 
> a bit of debate out there about using the Django AdminDateWidget verse 
> other solutions (Jquery, etc). Your decision to make but why increase 
> dependencies when you don't have to.
>
>
> As I'm still learning Django everything in the code below may not be 
> required but I'm listing it anyway. You may need to modify to your 
> particular environment.  As I don't have a blog to post this I'm sending it 
> to this group. I'm open to any suggestions for a better place to post this.
>
>
> For this example I will focus on adding a date picker for date of birth 
> (dob) and a date time picker for sponsor sign date (sponsor_sign_date). Key 
> items are in *Bold*.
>
>
> Another reference to adding the AdminDateTime widget is here: 
> http://stackoverflow.com/questions/38601/using-django-time-date-widgets-in-custom-form
>
>
>
>
> ---
>
> My top level (django-admin.py startproject izbo) directory Structure:
>
> mylogin@LX-D620:~/dev/izbo$ ll
>
> drwxrwxr-x 2 mylogin mylogin 4096 2009-03-17 10:52 account/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:53 add/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-18 04:34 adjudicator/ 
>
> drwxrwxr-x 2 mylogin mylogin 4096 2009-03-18 09:43 application/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-18 10:06 contract/ 
>
> drwxrwxrwx 2 mylogin mylogin 4096 2009-03-18 09:49 DB/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:51 employer/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-18 04:34 entity/ 
>
> -rw-r--r-- 1 mylogin mylogin 207 2009-03-08 04:54 exclude 
>
> drwxrwxrwx 2 mylogin mylogin 4096 2009-03-18 10:06 gzbo/ 
>
> -rw-r--r-- 1 mylogin mylogin 0 2009-01-06 04:55 __init__.py 
>
> -rw-r--r-- 1 mylogin mylogin 546 2009-01-06 04:55 manage.py 
>
> drwxrwxrwx 5 mylogin mylogin 4096 2009-02-08 12:35 media/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:53 member/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:52 note/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-02-20 12:47 search/ 
>
> -rw-r--r-- 1 mylogin mylogin 4192 2009-03-05 23:39 settings.py 
>
> drwxrwxrwx12 mylogin mylogin 4096 2009-03-16 11:48 templates/ 
>
> -rw-r--r-- 1 mylogin mylogin 2118 2009-03-16 11:16 urls.py 
>
>
> --
>
> Media directory Listing:
>
> mylogin@LX-D620:~/dev/izbo/media$ ll 
>
> total 12 
>
> drwxr-xr-x 5 mylogin mylogin 4096 2009-03-18 10:56 admin/ 
>
> drwxrwxrwx 2 mylogin mylogin 4096 2009-02-07 15:45 css/ 
>
> drwxrwxrwx 2 mylogin mylogin 4096 2009-01-27 10:07 images/ 
>
> lrwxrwxrwx 1 mylogin mylogin 36 2009-03-18 11:07 img -> 
> /home/mylogin/dev/izbo/media/admin/img/ 
>
>
> * Note: admin/ is 'cp -r' of directory 
> /usr/lib/python2.5/site-packages/django/contrib/admin/media.  Then I linked 
> the img directory.
>
>
>
> 
>
> In my “settings.py”
>
>
> import os.path 
>
> PROJECT_DIR = os.path.dirname(__file__) 
>
>
> MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media') 
>
> MEDIA_URL = 'http://www.izbo.com/media/'
>
> *ADMIN_MEDIA_PREFIX = '/media/admin/'*
>
> TEMPLATE_DIRS = ( 
>
>os.path.join(PROJECT_DIR, 'templates'),
>
>...
>
> )
>
>
> 
>
> In my top level “urls.py” file
>
> *from django.contrib import admin * 
>
>
> urlpatterns = patterns('', 
>
># Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
>
># to INSTALLED_APPS to enable admin documentation: 
>
>(r'^admin/doc/', include('django.contrib.admindocs.urls')), 
>
>
>*# Add this to get widgets.AdminDateWidget() working for non is_staff, 
> is_superuser * 
>
>*# This must be placed before (r'^admin/(.*)', admin.site.root), as 
> that gobals up everything * 
>
>*(r'^admin/jsi18n/$', 'django.views.i18n.javascript_catalog'), * 
>
>
># Uncomment the next line to enable the admin: 
>
>(r'^admin/(.*)', admin.site.root), 
>
>
># IZBO related URLs 
>
>(r'^$', splash), 
>
>.
>
> )
>
>
>
> -
>
> In “gzbo/models.py” 

Re: Newbie to Novice – Using Admin DateTime Picker in your Form

2016-09-18 Thread Mayank Rungta
Most of the posts I see around this topic are dated. I was wondering if 
this works for Django 1.8 upwards. Kindly let know if anybody has 
tried/tested any of these approaches on a more recent version of Django. I 
would like to stick to this approach rather than figure a plugin/javascript 
for every widget. I already see the need for datepicker and display of 
tables, both of which are very well done in the admin interface.

On Thursday, 19 March 2009 19:07:56 UTC+5:30, Paul Nema wrote:
>
> I've noticed many people new to Django (and sometimes also new to Python) 
> often post the same/similar questions in various forums. How to I get 
> something to work and/or do you have an example for X. As I've also 
> experienced this problem I've decided to post my little solution. Its not 
> the only way to do this, just the way I did it. Hopefully this will provide 
> the answer people are searching for or at least get them started. I guess 
> it will also serve as a quick code review by those so inclined to comment.
>
>
> You've probably heard of DRY but I think something is missing. There 
> should also be a Don't Repeat Other's Work (DROW) when they already solved 
> the problem. Thus another motivation to post this.  On a side note there is 
> a bit of debate out there about using the Django AdminDateWidget verse 
> other solutions (Jquery, etc). Your decision to make but why increase 
> dependencies when you don't have to.
>
>
> As I'm still learning Django everything in the code below may not be 
> required but I'm listing it anyway. You may need to modify to your 
> particular environment.  As I don't have a blog to post this I'm sending it 
> to this group. I'm open to any suggestions for a better place to post this.
>
>
> For this example I will focus on adding a date picker for date of birth 
> (dob) and a date time picker for sponsor sign date (sponsor_sign_date). Key 
> items are in *Bold*.
>
>
> Another reference to adding the AdminDateTime widget is here: 
> http://stackoverflow.com/questions/38601/using-django-time-date-widgets-in-custom-form
>
>
>
>
> ---
>
> My top level (django-admin.py startproject izbo) directory Structure:
>
> mylogin@LX-D620:~/dev/izbo$ ll
>
> drwxrwxr-x 2 mylogin mylogin 4096 2009-03-17 10:52 account/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:53 add/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-18 04:34 adjudicator/ 
>
> drwxrwxr-x 2 mylogin mylogin 4096 2009-03-18 09:43 application/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-18 10:06 contract/ 
>
> drwxrwxrwx 2 mylogin mylogin 4096 2009-03-18 09:49 DB/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:51 employer/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-18 04:34 entity/ 
>
> -rw-r--r-- 1 mylogin mylogin 207 2009-03-08 04:54 exclude 
>
> drwxrwxrwx 2 mylogin mylogin 4096 2009-03-18 10:06 gzbo/ 
>
> -rw-r--r-- 1 mylogin mylogin 0 2009-01-06 04:55 __init__.py 
>
> -rw-r--r-- 1 mylogin mylogin 546 2009-01-06 04:55 manage.py 
>
> drwxrwxrwx 5 mylogin mylogin 4096 2009-02-08 12:35 media/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:53 member/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-03-17 10:52 note/ 
>
> drwxr-xr-x 2 mylogin mylogin 4096 2009-02-20 12:47 search/ 
>
> -rw-r--r-- 1 mylogin mylogin 4192 2009-03-05 23:39 settings.py 
>
> drwxrwxrwx12 mylogin mylogin 4096 2009-03-16 11:48 templates/ 
>
> -rw-r--r-- 1 mylogin mylogin 2118 2009-03-16 11:16 urls.py 
>
>
> --
>
> Media directory Listing:
>
> mylogin@LX-D620:~/dev/izbo/media$ ll 
>
> total 12 
>
> drwxr-xr-x 5 mylogin mylogin 4096 2009-03-18 10:56 admin/ 
>
> drwxrwxrwx 2 mylogin mylogin 4096 2009-02-07 15:45 css/ 
>
> drwxrwxrwx 2 mylogin mylogin 4096 2009-01-27 10:07 images/ 
>
> lrwxrwxrwx 1 mylogin mylogin 36 2009-03-18 11:07 img -> 
> /home/mylogin/dev/izbo/media/admin/img/ 
>
>
> * Note: admin/ is 'cp -r' of directory 
> /usr/lib/python2.5/site-packages/django/contrib/admin/media.  Then I linked 
> the img directory.
>
>
>
> 
>
> In my “settings.py”
>
>
> import os.path 
>
> PROJECT_DIR = os.path.dirname(__file__) 
>
>
> MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media') 
>
> MEDIA_URL = 'http://www.izbo.com/media/'
>
> *ADMIN_MEDIA_PREFIX = '/media/admin/'*
>
> TEMPLATE_DIRS = ( 
>
>os.path.join(PROJECT_DIR, 'templates'),
>
>...
>
> )
>
>
> 
>
> In my top level “urls.py” file
>
> *from django.contrib import admin * 
>
>
> urlpatterns = patterns('', 
>
># Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
>
># to INSTALLED_APPS to enable admin documentation: 
>
>(r'^admin/doc/', include('django.contrib.admindocs.urls')), 
>
>
>*# Add this to get widgets.AdminDateWidget() working for non is_staff, 
> is_superuser * 
>
>*# This must be placed before (r'^admin/(.*)', admin.site.root), as 
> that gobals up everything * 
>
>*(r'^admin/jsi18n/$', 'django.views.i18n.javascript_catalog'), * 
>
>
># Uncomment the next line to 

Re: Newbie question regarding uninstalling Django system-wide.

2016-07-13 Thread Leo
Thanks Mike

On Tuesday, July 12, 2016 at 8:03:18 PM UTC-4, Mike Dewhirst wrote:
>
> On 13/07/2016 1:55 AM, Leo wrote: 
> > I am learning how to use Django. With my first attempt I did not use a 
> > virtual environment instead installed Django system-wide. Now I have 
> > learned to utilize virtual environments. Can you help me learn how to 
> > uninstall the system-wide Django instance? Also, I can't recall if I 
> > used pip or apt-get. Or do I need to be concerned with this at all, 
> > meaning will the base install conflict with instances installed in the 
> > virtual environments? 
>
> sudo pip uninstall django 
>
> sudo apt-get remove django 
>
> The base install is unnecessary if Django is installed in the venv and 
> it should not conflict. 
>
> It is best to avoid any base installs unless you *know* they will be 
> used by all venvs 
>
>
> > 
> > 
> > Your help is appreciated. 
> > 
> > Leo 
> > 
> > -- 
> > 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...@googlegroups.com  
> > . 
> > To post to this group, send email to django...@googlegroups.com 
>  
> > . 
> > Visit this group at https://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/638a94f9-8bb8-40c4-80f2-204b0479dc74%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/django-users/638a94f9-8bb8-40c4-80f2-204b0479dc74%40googlegroups.com?utm_medium=email_source=footer>.
>  
>
> > 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/99ad53fd-8951-46f1-90d8-b88f760ee586%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question regarding uninstalling Django system-wide.

2016-07-12 Thread Mike Dewhirst

On 13/07/2016 1:55 AM, Leo wrote:

I am learning how to use Django. With my first attempt I did not use a
virtual environment instead installed Django system-wide. Now I have
learned to utilize virtual environments. Can you help me learn how to
uninstall the system-wide Django instance? Also, I can't recall if I
used pip or apt-get. Or do I need to be concerned with this at all,
meaning will the base install conflict with instances installed in the
virtual environments?


sudo pip uninstall django

sudo apt-get remove django

The base install is unnecessary if Django is installed in the venv and 
it should not conflict.


It is best to avoid any base installs unless you *know* they will be 
used by all venvs






Your help is appreciated.

Leo

--
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/638a94f9-8bb8-40c4-80f2-204b0479dc74%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/71ea4c0f-886d-7fa7-8c8e-267f9cb93715%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Newbie question regarding uninstalling Django system-wide.

2016-07-12 Thread Leo


I am learning how to use Django. With my first attempt I did not use a 
virtual environment instead installed Django system-wide. Now I have 
learned to utilize virtual environments. Can you help me learn how to 
uninstall the system-wide Django instance? Also, I can't recall if I used 
pip or apt-get. Or do I need to be concerned with this at all, meaning will 
the base install conflict with instances installed in the virtual 
environments?


Your help is appreciated.

Leo

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/638a94f9-8bb8-40c4-80f2-204b0479dc74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: (Newbie) Stuck with annotate() docs

2016-04-28 Thread Ankush Thakur
Yup! Makes sense now. I hope it saves someone some trouble someday. :-)

Thanks a lot, Tim!

Best,
Ankush

On Thursday, April 28, 2016 at 12:21:35 AM UTC+5:30, Tim Graham wrote:
>
> Please give this a try: https://github.com/django/django/pull/6524
>
> On Wednesday, April 27, 2016 at 10:45:03 AM UTC-4, Ankush Thakur wrote:
>>
>> I'm not sure how Book.objects.first().chapters is different 
>> from Book.objects.first().chapters.count(), but the point is that 
>> "chapters" is not defined in the models at the top of that page! The 
>> snippet makes sense if I treat Book.chapters as another ManyToManyField 
>> (like authors), but it's really weird to see that error in the docs. So, 
>> does that mean I can report it? If yes, to who?
>>
>> On Wednesday, April 27, 2016 at 4:36:40 AM UTC+5:30, Tim Graham wrote:
>>>
>>> Looks like a typo. Does the rest of the example make sense and work if 
>>> that line is changed to "Book.objects.first().chapters"?
>>>
>>> On Tuesday, April 26, 2016 at 12:50:31 PM UTC-4, Ankush Thakur wrote:

 Folks, I'm having exceptional trouble understanding annotate(), 
 aggregate(), and their various combinations. I'm currently stuck here: 
 https://docs.djangoproject.com/en/1.9/topics/db/aggregation/#combining-multiple-aggregations

 The example here uses Book.objects.first().chapters.count(), but 
 there's no chapters model or field at the start of the tutorial. It's 
 frustrating, to say the least. Even if I set up a separate application to 
 test this myself, what do I make of "chapters"? Is it another model with 
 many-to-many relation with Book? When I ran an example with the following 
 models:

 class Author(models.Model):
 name = models.CharField(max_length=100)
 age = models.IntegerField()

 class Book(models.Model):
 name = models.CharField(max_length=300)
 chapters = models.IntegerField()
 authors = models.ManyToManyField(Author)

 I got: 

 >>> Book.objects.first().chapters.count()
 Traceback (most recent call last):
   File "", line 1, in 
 AttributeError: 'int' object has no attribute 'count'
 >>> 

 So basically, I feel like I'm screwed. Please help.

>>>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20a60d70-ef3b-4036-9e5d-dbe228a250ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: (Newbie) Stuck with annotate() docs

2016-04-27 Thread Tim Graham
Please give this a try: https://github.com/django/django/pull/6524

On Wednesday, April 27, 2016 at 10:45:03 AM UTC-4, Ankush Thakur wrote:
>
> I'm not sure how Book.objects.first().chapters is different 
> from Book.objects.first().chapters.count(), but the point is that 
> "chapters" is not defined in the models at the top of that page! The 
> snippet makes sense if I treat Book.chapters as another ManyToManyField 
> (like authors), but it's really weird to see that error in the docs. So, 
> does that mean I can report it? If yes, to who?
>
> On Wednesday, April 27, 2016 at 4:36:40 AM UTC+5:30, Tim Graham wrote:
>>
>> Looks like a typo. Does the rest of the example make sense and work if 
>> that line is changed to "Book.objects.first().chapters"?
>>
>> On Tuesday, April 26, 2016 at 12:50:31 PM UTC-4, Ankush Thakur wrote:
>>>
>>> Folks, I'm having exceptional trouble understanding annotate(), 
>>> aggregate(), and their various combinations. I'm currently stuck here: 
>>> https://docs.djangoproject.com/en/1.9/topics/db/aggregation/#combining-multiple-aggregations
>>>
>>> The example here uses Book.objects.first().chapters.count(), but there's 
>>> no chapters model or field at the start of the tutorial. It's frustrating, 
>>> to say the least. Even if I set up a separate application to test this 
>>> myself, what do I make of "chapters"? Is it another model with many-to-many 
>>> relation with Book? When I ran an example with the following models:
>>>
>>> class Author(models.Model):
>>> name = models.CharField(max_length=100)
>>> age = models.IntegerField()
>>>
>>> class Book(models.Model):
>>> name = models.CharField(max_length=300)
>>> chapters = models.IntegerField()
>>> authors = models.ManyToManyField(Author)
>>>
>>> I got: 
>>>
>>> >>> Book.objects.first().chapters.count()
>>> Traceback (most recent call last):
>>>   File "", line 1, in 
>>> AttributeError: 'int' object has no attribute 'count'
>>> >>> 
>>>
>>> So basically, I feel like I'm screwed. Please help.
>>>
>>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7239e49a-1b5c-4a2a-9e50-d7e6ecfb7cd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: (Newbie) Stuck with annotate() docs

2016-04-27 Thread Ankush Thakur
I'm not sure how Book.objects.first().chapters is different 
from Book.objects.first().chapters.count(), but the point is that 
"chapters" is not defined in the models at the top of that page! The 
snippet makes sense if I treat Book.chapters as another ManyToManyField 
(like authors), but it's really weird to see that error in the docs. So, 
does that mean I can report it? If yes, to who?

On Wednesday, April 27, 2016 at 4:36:40 AM UTC+5:30, Tim Graham wrote:
>
> Looks like a typo. Does the rest of the example make sense and work if 
> that line is changed to "Book.objects.first().chapters"?
>
> On Tuesday, April 26, 2016 at 12:50:31 PM UTC-4, Ankush Thakur wrote:
>>
>> Folks, I'm having exceptional trouble understanding annotate(), 
>> aggregate(), and their various combinations. I'm currently stuck here: 
>> https://docs.djangoproject.com/en/1.9/topics/db/aggregation/#combining-multiple-aggregations
>>
>> The example here uses Book.objects.first().chapters.count(), but there's 
>> no chapters model or field at the start of the tutorial. It's frustrating, 
>> to say the least. Even if I set up a separate application to test this 
>> myself, what do I make of "chapters"? Is it another model with many-to-many 
>> relation with Book? When I ran an example with the following models:
>>
>> class Author(models.Model):
>> name = models.CharField(max_length=100)
>> age = models.IntegerField()
>>
>> class Book(models.Model):
>> name = models.CharField(max_length=300)
>> chapters = models.IntegerField()
>> authors = models.ManyToManyField(Author)
>>
>> I got: 
>>
>> >>> Book.objects.first().chapters.count()
>> Traceback (most recent call last):
>>   File "", line 1, in 
>> AttributeError: 'int' object has no attribute 'count'
>> >>> 
>>
>> So basically, I feel like I'm screwed. Please help.
>>
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9d9fee0c-c4d0-4f2d-9575-f6f4e4bfab3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: (Newbie) Stuck with annotate() docs

2016-04-26 Thread Tim Graham
Looks like a typo. Does the rest of the example make sense and work if that 
line is changed to "Book.objects.first().chapters"?

On Tuesday, April 26, 2016 at 12:50:31 PM UTC-4, Ankush Thakur wrote:
>
> Folks, I'm having exceptional trouble understanding annotate(), 
> aggregate(), and their various combinations. I'm currently stuck here: 
> https://docs.djangoproject.com/en/1.9/topics/db/aggregation/#combining-multiple-aggregations
>
> The example here uses Book.objects.first().chapters.count(), but there's 
> no chapters model or field at the start of the tutorial. It's frustrating, 
> to say the least. Even if I set up a separate application to test this 
> myself, what do I make of "chapters"? Is it another model with many-to-many 
> relation with Book? When I ran an example with the following models:
>
> class Author(models.Model):
> name = models.CharField(max_length=100)
> age = models.IntegerField()
>
> class Book(models.Model):
> name = models.CharField(max_length=300)
> chapters = models.IntegerField()
> authors = models.ManyToManyField(Author)
>
> I got: 
>
> >>> Book.objects.first().chapters.count()
> Traceback (most recent call last):
>   File "", line 1, in 
> AttributeError: 'int' object has no attribute 'count'
> >>> 
>
> So basically, I feel like I'm screwed. Please help.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6527650e-9b58-47a5-8e65-95fd976902cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Newbie) Stuck with annotate() docs

2016-04-26 Thread Ankush Thakur
Folks, I'm having exceptional trouble understanding annotate(), 
aggregate(), and their various combinations. I'm currently stuck 
here: 
https://docs.djangoproject.com/en/1.9/topics/db/aggregation/#combining-multiple-aggregations

The example here uses Book.objects.first().chapters.count(), but there's no 
chapters model or field at the start of the tutorial. It's frustrating, to 
say the least. Even if I set up a separate application to test this myself, 
what do I make of "chapters"? Is it another model with many-to-many 
relation with Book? When I ran an example with the following models:

class Author(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()

class Book(models.Model):
name = models.CharField(max_length=300)
chapters = models.IntegerField()
authors = models.ManyToManyField(Author)

I got: 

>>> Book.objects.first().chapters.count()
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'int' object has no attribute 'count'
>>> 

So basically, I feel like I'm screwed. Please help.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ea169a1e-d55a-457c-b0bd-19d6d96626d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Newbie - Tutorial Recommendations?

2016-03-19 Thread Anthony W Smith


On Friday, March 18, 2016 at 8:31:56 AM UTC-4, Santosh Srinivas wrote:
>
> Hi Folks,
>
> I'm new to both Python and Django.
> I am looking for high quality video tutorials on Django and Python from 
> your experience (paid is also fine).
>
> Please advise.
>
> Thank you.
> Santosh
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4a7a68f0-dab1-4901-bcb0-8702b9758f7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Newbie - Tutorial Recommendations?

2016-03-19 Thread Santosh Srinivas
Hi Folks,

I'm new to both Python and Django.
I am looking for high quality video tutorials on Django and Python from 
your experience (paid is also fine).

Please advise.

Thank you.
Santosh

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aedc789c-f8d7-4314-b52a-ccb764c56edb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Newbie - Tutorial Recommendations?

2016-03-19 Thread Bill Freeman
As far as learning python goes, especially if you already program in
another language, the tutorials at docs.python.org are quite good.  If you
are using python 2 instead of python 3, note the "Docs for other versions"
section in the top of the left hand column.  If you don't already program
in some other language, you might consider a book for python beginners.

On Fri, Mar 18, 2016 at 10:40 AM, Stanislav Vasko  wrote:

> Hello,
>
> i found very usefull general tutorial at Django site:
> https://docs.djangoproject.com/en/1.9/intro/tutorial01/
>
> But you can try DjangoGirls (dont worry, its not just for girls):
> http://tutorial.djangogirls.org
>
> Good Luck!
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e62fffa8-a35d-4e66-a392-15e35566ab87%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB%2BAj0smk1NLnDWv%2BEMLCKWmv74qCcrK9zi0%3D8TOMRO-a0DCng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Newbie - Tutorial Recommendations?

2016-03-19 Thread Rafael E. Ferrero
The main Django project website has an amazing good tutorial and
documentation for start.



Rafael E. Ferrero

2016-03-18 6:54 GMT-03:00 Santosh Srinivas :

> Hi Folks,
>
> I'm new to both Python and Django.
> I am looking for high quality video tutorials on Django and Python from
> your experience (paid is also fine).
>
> Please advise.
>
> Thank you.
> Santosh
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/aedc789c-f8d7-4314-b52a-ccb764c56edb%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJJc_8U-S41fwJNDgLXquKy9UY4VTdA-XA5Yj%3DUW1meNmTQvJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   4   5   6   7   8   9   10   >