Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Andy
Please forget about the persisting data part. The problem is that inside the parent form i dont have access to the related data and the formsets new related data is validated after the parent models data. Inside the formset every related data model does not have access to the other related inst

Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Jason
I still don't understand why you want to persist unvalidated data to the db then? if a user requests the data in mid-update, that's something that can be handled with transaction locks on the db. so when that happens, the request will wait till the locks are released before executing the db qu

Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Andy
Am Sonntag, 26. August 2018 18:29:49 UTC+2 schrieb Jason: > > I think we're missing a few things. how fast does this query with updated > values execute after the form submits? > a neglectable amount of milliseconds > if you need to return the value back to the view, can't you do some sort

Re: template tag help please?

2018-08-26 Thread Tosin Ayoola
good day guys I'm working on a project but currently I'm having issues, which is I created a model to save some images files & I created a template to display the images but the issue now is for loop isn't displaying the files at the template On 8/23/18, Tosin Ayoola wrote: > this is the link htt

Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Jason
I think we're missing a few things. how fast does this query with updated values execute after the form submits? if you need to return the value back to the view, can't you do some sort of post-save retrieval and form populate? -- You received this message because you are subscribed to the Go

Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Andy
Am Sonntag, 26. August 2018 18:07:25 UTC+2 schrieb Jason: > > why would you want to persist unvalidated data to your db? > >> >> Well, i dont necessarily have to, but i somehow need to be able to perform a query with all updated data taken into account. The easiest solution i came up with is pu

Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Jason
why would you want to persist unvalidated data to your db? On Sunday, August 26, 2018 at 10:42:28 AM UTC-4, Andy wrote: > > I want to execute a check after the related data from the admin has been > saved, but the default clean methods get executed before the formsets are > saved. Where could i

How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Andy
I want to execute a check after the related data from the admin has been saved, but the default clean methods get executed before the formsets are saved. Where could i place my check to have access to a full version of what has been changed on the admin page? -- You received this message becau

Re: Documentation

2018-08-26 Thread Artur Gevorgyan
Thank you in advanced) I actually know about the two versions of python the differences, and about not compatibility. So I've learned the main concerns in python and I just wanted to have a overlook to django yet not in real project. But the case I have mentioned was just for a non programmer a gr

Re: Documentation

2018-08-26 Thread Jason
Furthermore, the reason this isn't mentioned in the django docs is because its assumed the developer will have familiarity with python. I would suggest you get comfortable with python and then learn a framework like django/flask. Learning both at the same time can be done (I did it), but it w

Re: Documentation

2018-08-26 Thread Jason
basically, there's two versions of python: python 2 and 3. They're incompatible with each other, though there's ways you can get py2 code to run in py3 (the inverse is not true). Effectively, think of what ES6 would have been like if TC39 had the guts to make a backwards incompatible version

Documentation

2018-08-26 Thread Artur Gevorgyan
Hi to all. In the documentation the whole examples are for machine that has only one python version installed. So I was trying for an hour to understand what I've done wrong with django instalation. But the reason was I was typing `python` instead of `python3`. Please give some note about that.

Re: Update data instead of creating a new row entry in django model

2018-08-26 Thread Jason
what you should do in your post check is bill_item = BillItem.objects.get(code = itemcode) form = BillItem(request.POST, instance = bill_item) This populates the form with the existing model instance and merges with the post data. you then can run form.save() to persist the update

Re: Django database problem

2018-08-26 Thread Jason
yeah, there is a limit, and its set by the data type you use for the id field. by default, id is set to IntegerField which has a maximum value of 2147483647 sounds like the issue with the ids jumping aro

Re: Error during GeoDjango tutorial documentaion

2018-08-26 Thread Jason
this might be related: https://groups.google.com/forum/#!topic/geodjango/Imkq2DDI7qg -- 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...@g

Re: Error during GeoDjango tutorial documentaion

2018-08-26 Thread Benjamin Smith
I am using these version: gdal-bin v2.2.3+dfsg-2 Python v3.6.5 Django v2.1 psycopg2 v2.7.5 postgis v2.4.3+dfsg-4 On Sun, Aug 26, 2018 at 3:45 PM Benjamin Smith wrote: > I am going through the GeoDjango tutorial from the official documentation. > >1. I have installed the required geospatial

Re: Django database problem

2018-08-26 Thread Mikko Meronen
Hi, Thanks for advice ^^ I have one new concern. Is there a limit for for Django model IDs? Now I have automated the data insert with python code loop, but the ID-number is not consecutive. It jumps for example from ...56 to 571... and from ...587 to 3763... and so forth. Do you know why it is

Error during GeoDjango tutorial documentaion

2018-08-26 Thread Benjamin Smith
I am going through the GeoDjango tutorial from the official documentation. 1. I have installed the required geospatial libraries, installed and enabled spatial functionality by extending the PostgreSQL via postgis. 2. Downloaded the world borders data, and have unzipped the data. 3. Cr

Re: Geographical location filter app in Django

2018-08-26 Thread Benjamin Smith
Okay. Thank you for your insight. On Thu, Aug 23, 2018 at 3:06 PM Christian Ledermann < christian.lederm...@gmail.com> wrote: > Go with geo django, postgis will accelerate these kind of lookups with > indices. > > https://stackoverflow.com/questions/19703975/django-sort-by-distance/35896358#35896

Re: Update the django project from local to production

2018-08-26 Thread Mikhailo Keda
Check the documentation - https://docs.djangoproject.com/en/2.1/howto/deployment/ субота, 25 серпня 2018 р. 12:35:20 UTC+3 користувач Kamal Sharma написав: > > Hey, > How i have deployed my django project to my VPS and now i have done some > change in my local django project and want to update o

Update data instead of creating a new row entry in django model

2018-08-26 Thread Joel Mathew
I have a page for editing existing data from a model. The model: class billitem(models.Model): code = models.AutoField(primary_key=True, unique=True) name = models.CharField(max_length=35) description = models.CharField(max_length=60, null=True) price = models.