Re: Working with forms

2020-04-03 Thread Bruckner de Villiers
Please share code for home.html & urls.py.  Also have you included the app name in the settings.py? Thanks, Bruckner de Villiers 083 625 1086 From: on behalf of Ifeanyi Chielo Reply to: Date: Saturday, 04 April 2020 at 02:51 To: Django users Subject: Re: Working with f

Re: A question about the Django server

2020-03-20 Thread Bruckner de Villiers
Have you set up your admin.py? Bruckner de Villiers 083 625 1086 From: on behalf of Liu楽叁 Reply to: Date: Friday, 20 March 2020 at 14:05 To: Django users Subject: A question about the Django server I am using windows and I started a server by 'py manage.py runserver

Re: Any newbies especially in Cape Town for meetups?

2020-02-17 Thread Bruckner de Villiers
Why not start a Django Meetup Group? There is already a Python Meetup Group. I would be interested. Regards, Bruckner de Villiers 083 625 1086 On 2020/02/16, 12:16, "Perceval Maturure" wrote: That’s a good point. How about, could you elaborate on how this can be done? S

Re: AutoField & auto-incrementing

2020-02-12 Thread Bruckner de Villiers
Useful, thanks Mike. Bruckner de Villiers 083 625 1086 On 2020/02/12, 23:18, "Mike Dewhirst" wrote: On 12/02/2020 6:54 pm, Mike Dewhirst wrote: > def save(self, *args, **kwargs): > self._pre_save()# stuff to be computed pre-save > super().s

Re: AutoField & auto-incrementing

2020-02-12 Thread Bruckner de Villiers
Thanks Mike - I have just become cleverer. Bruckner de Villiers 083 625 1086 On 2020/02/12, 09:55, "Mike Dewhirst" wrote: On 12/02/2020 6:11 pm, Bruckner de Villiers wrote: > Mike, > Clever. The save function seems to write a string of the id. So, self.form

Re: AutoField & auto-incrementing

2020-02-11 Thread Bruckner de Villiers
Mike, Clever. The save function seems to write a string of the id. So, self.formulation_no = "50-" + str(self.id) could also work? Bruckner de Villiers +27 83 625 1086 On 2020/02/12, 00:27, "Mike Dewhirst" wrote: On 11/02/2020 7:06 pm, Bruckner de Villiers wrot

Re: AutoField & auto-incrementing

2020-02-11 Thread Bruckner de Villiers
Jason, I cracked the uuid option – what an ugly ticket no.!!! - 0273051c-af54-4baf-91b9-651701d9020c Bruckner de Villiers 083 625 1086 From: Bruckner de Villiers Date: Tuesday, 11 February 2020 at 10:06 To: Subject: AutoField & auto-incrementing Jason, Thank you. I have cha

AutoField & auto-incrementing

2020-02-11 Thread Bruckner de Villiers
track of the last used ticket no.  I haven’t thought this through yet, but it does occur to me that one could use the id (maybe prefix the id with some starting digits) and write the record twice.  Probably barking up the wrong tree. Regards, Bruckner de Villiers +27 83 625 1086 From

Re: to add counter to an object of a table

2020-02-10 Thread Bruckner de Villiers
Brajesh, I presume that you want the counter to auto-increment.  The gurus are recommending AutoField, but I can’t get it to work yet and the Django docs are a bit vague on the subect. Good luck. Bruckner de Villiers 083 625 1086 From: on behalf of BRAJESH KUMAR Reply to: Date

Re: Adding a verbose_name to id field

2020-02-10 Thread Bruckner de Villiers
    def get_absolute_url(self):     print(self.pk)     return reverse("bugs/bug_detail",kwargs={'pk':self.pk})     def __str__(self):     return self.bug_title Thanks for your attention to date. Bruckner de Villiers 083 625 1086 From: on behal

Re: Adding a verbose_name to id field

2020-02-09 Thread Bruckner de Villiers
Thank you Mike & Jason. I agree - messing around with the id is not the brightest idea I've ever conceived. However, the Django 3 documentation is somewhat mute on auto-incrementing, but I'll continue searching Stack & Mozilla. Have a great evening (I am GMT+2). Regards, Bruckner de

Re: Adding a verbose_name to id field

2020-02-08 Thread Bruckner de Villiers
, but merely requires an explanatory field text. Make sense? Bruckner de Villiers 083 625 1086 From: on behalf of Mike Dewhirst Reply to: Date: Saturday, 08 February 2020 at 13:48 To: Subject: RE: Adding a verbose_name to id field I imagine you need to specify the id field in your

Adding a verbose_name to id field

2020-02-08 Thread Bruckner de Villiers
Using Sqlite3 & Django 3.0.2 - I have searched high and low, but can’t find a way to add a verbose name to the id of a model. Anyone have ideas, please? Bruckner de Villiers +27 83 625 1086 -- You received this message because you are subscribed to the Google Groups "Django use

Re: Backward migration failing because of old dropped model

2020-01-20 Thread Bruckner de Villiers
they shouldn’t have been deleted. Bruckner de Villiers 083 625 1086 From: on behalf of Adrien Agnel Reply to: Date: Monday, 20 January 2020 at 22:07 To: Django users Subject: Backward migration failing because of old dropped model Hi everyone, This is my first post in this group so do

Re: Django Lessons

2020-01-19 Thread Bruckner de Villiers
Eugen, As a Newbie, I found  most of it useful. Well done. Bruckner de Villiers 083 625 1086 From: on behalf of Eugen Ciur Reply to: Date: Sunday, 19 January 2020 at 21:56 To: Django users Subject: Django Lessons Hi everyone, I launched recently a new resource, django

Re: Model Related Issue

2020-01-15 Thread Bruckner de Villiers
I guess that this is a fundamental change to the db – Best to first delete the old model and start again. Bruckner de Villiers 083 625 1086 From: on behalf of ROHIT CHAUHAN Reply to: Date: Wednesday, 15 January 2020 at 12:33 To: Subject: Re: Model Related Issue manually change

Pagination in Admin class

2020-01-11 Thread Bruckner de Villiers
, {'fields':('currency_Code', 'currency_Description')}),     ) Much obliged, Bruckner de Villiers 083 625 1086 -- 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, sen

Re: unable to execute 'workon' command

2019-12-12 Thread Bruckner de Villiers
https://stackoverflow.com/questions/29900090/virtualenv-workon-doesnt-work Bruckner de Villiers 083 625 1086 From: on behalf of rishabh roy Reply to: Date: Friday, 13 December 2019 at 07:38 To: Subject: Re: unable to execute 'workon' command I am student trying to do

Re: Multiple Apps in one project with one database

2019-12-11 Thread Bruckner de Villiers
OK, got it.  Changed polls2/views.py to “from polls.models import Choice, Question” instead of “from .models import Choice, Question”.  It works, but VSCode doesn’t like “polls.model” – it gives a warning “unresolved import”. Much obliged, Bruckner de Villiers 083 625 1086 From

Re: SuperUser not logging out after reboot

2019-12-11 Thread Bruckner de Villiers
Thank you – thought that this is the case.  However, I am trying to cater for the user who forgot to log out. Regards, Bruckner de Villiers 083 625 1086 From: on behalf of Miracle Reply to: Date: Wednesday, 11 December 2019 at 12:09 To: Subject: Re: SuperUser not logging out after

Multiple Apps in one project with one database

2019-12-11 Thread Bruckner de Villiers
I have probably messed up with models.py.  Any pointers please as how multiple apps can point to the same database? Regards, Bruckner de Villiers +27(0)83 625 1086 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe f

SuperUser not logging out after reboot

2019-12-11 Thread Bruckner de Villiers
setup.  Is there a way to log out a user automatically after a set period of time? Much obliged, Bruckner de Villiers 083 625 1086 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiv

Re: Removing Hardcoded urls in Templates

2019-12-10 Thread Bruckner de Villiers
Thank you Daniel. Bruckner de Villiers 083 625 1086 From: on behalf of Daniel Hepper Reply to: Date: Tuesday, 10 December 2019 at 13:54 To: Subject: Re: Removing Hardcoded urls in Templates It should be {% url 'polls:detail' question.id %} I think you mixed up the steps

Re: Removing Hardcoded urls in Templates

2019-12-10 Thread Bruckner de Villiers
Thank you Sencer. Bruckner de Villiers 083 625 1086 From: on behalf of Sencer Hamarat Reply to: Date: Tuesday, 10 December 2019 at 13:51 To: Subject: Re: Removing Hardcoded urls in Templates Would you please replace url name with 'polls:detail', as described at https

Removing Hardcoded urls in Templates

2019-12-10 Thread Bruckner de Villiers
nse % question_id) def vote(request, question_id):     return HttpResponse("You're voting on question %s." % question_id) Much obliged, Bruckner de Villiers 083 625 1086 -- You received this message because you are subscribed to the Google Groups "Django u

Re: Difficulty with Tutorial Part 2

2019-12-09 Thread Bruckner de Villiers
; datetime and timedelta from the module datetime. > > If you prefer to use "datetime.timedelta", you would have to use "import > datetime" instead of "from datetime import datetime, timedelta" > > Hope that helps, > Daniel > >> On Mon, Dec

Difficulty with Tutorial Part 2

2019-12-09 Thread Bruckner de Villiers
IntegerField(default=0)     def __str__(self):     return self.choice_text Much obliged, Bruckner de Villiers +27 (0)83 625 1086 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Re: Why is the Django server running even when pytlinter shows that there's some bug in the code?

2019-12-04 Thread Bruckner de Villiers
Which tutorial are you following?  Is it any good? Bruckner de Villiers 083 625 1086 From: on behalf of Aaryan Dewan Reply to: Date: Tuesday, 03 December 2019 at 16:52 To: Django users Subject: Re: Why is the Django server running even when pytlinter shows that there's some bug

Re: Why is the Django server running even when pytlinter shows that there's some bug in the code?

2019-12-03 Thread Bruckner de Villiers
I had the same issue and after trying various weird solutions on Stackoverflow, none of which worked, I found this simple solution – add this comment code to each line giving the error and it magically disappears: # pylint: disable=no-member Bruckner de Villiers 083 625 1086 From

Re: pass parameter from one class view to another

2019-11-05 Thread Bruckner de Villiers
{% endblock %} So, when the user clicks on an organisation in the list it takes her to the DetailView of that organisation, by virtue of the line in the urls.py: path('/', views.Org_DetailView.as_view(), name='detail'), Caveat – I am still an novice, but this works for me. Bruckner de

Re:

2019-11-05 Thread Bruckner de Villiers
Udemy has a good course leading up to this topic – Python and Django Full Stack Web Development, still based on Django 1.x, but Django 2.x code is incuded. Regards, Bruckner de Villiers 083 625 1086 From: on behalf of Paras Jain Reply to: Date: Tuesday, 05 November 2019 at 07:41

Re: Field Select MasterDetail

2019-10-31 Thread Bruckner de Villiers
I have a similar challenge and I think that I shall tackle it by making the first level dependency outside the main model, i.e. Building should be a ForeignKey in BuildingOwner model. Then your main model shouldn’t have the a link to the Building model, but rather 2 ForeignKeys to

Re: html home file is not opening while running under django env......

2019-10-31 Thread Bruckner de Villiers
Did you import include? Bruckner 0836251086 > On 01 Nov 2019, at 00:29, হজমুলা খান wrote: > >  > > >> On Thursday, October 31, 2019 at 12:22:48 PM UTC, Kasper Laudrup wrote: >> Hi হজমুলা খান, >> >> On 31/10/2019 11.22, হজমুলা খান wrote: >> > i am novice and following django for beginners

Re: Export HTML template filled by form to HTML file

2019-10-31 Thread Bruckner de Villiers
y what it says – e.g. OrgUpdateView allows me to update a previously created record in the DB.  The urls.py and *.html are a bit more complicated.  But, I can share these with you as well.  I learnt/am learning this stuff through Python and Django Full Stack Web Developer Bootcamp from Udemy. R