GEODJANGO Problem/Question

2022-05-10 Thread Steve Watts
I am running a LayerMapping on a set of ShapeFiles acquired from a County 
GIS Department. I've done a quite a bit of this, and this is the first time 
I"ve seen such an issue. As LayerMapping is proceeding through the file 
saving model instances, it encounters one that it can't handle:

"GDAL_ERROR 1: b'Geometry of polygon of fid 5572 cannot be translated to 
Simple Geometry. All polygons will be contained in a multipolygon.'"
"GDAL_ERROR 1: b'organizePolygons() received an unexpected geometry. 
 Either a polygon with interior rings, or a polygon with less than 4 
points, or a non-Polygon geometry.  Return arguments as a collection.'"
"GEOS_ERROR: IllegalArgumentException: Invalid number of points in 
LinearRing found 3 - must be 0 or >= 4"
"Failed to save the feature (id: 5572) into the model with the keyword 
arguments:"
And the final Exception:
"GEOSException: Error encountered checking Geometry returned from GEOS C 
function "GEOSWKTReader_read_r"."

The best description of the issue I can find is 
https://github.com/r-spatial/sf/issues/1589. In this help thread, and a 
related one, they talk about a utility called "MakeValid" to resolve this 
LinearRing issue.

It appears I need to either add a point to any of these "LinearRing" 
instances, or somehow otherwise fix these items.

I'm not sure that sending the ShapeFiles back to the County to "fix" would 
be productive.

Does anyone have anything to contribute as far as how I might best move 
forward with this set of ShapeFiles?

Is there another forum where I should be addressing this issue? Need more 
information?

Thanks!

Steve Watts

-- 
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/82fe8d9e-e83a-4e6c-bde1-1665ddd45670n%40googlegroups.com.


Re: Single user as a seller and buyer at the same time.

2022-05-10 Thread George Tantiras
I cannot but agree with Kasper, but here is a naive example: @login_requireddef create_sale_view(request):   if request.user.has_perm("sell.add_product"):       # The user can add new product for sale   else:       # The user cannot add new product for salehttps://docs.djangoproject.com/en/4.0/topics/auth/default/#default-permissions  10.05.2022, 15:06, "Kasper Laudrup" :On 10/05/2022 11.53, DJANGO DEVELOPER wrote: yes, I know. but how to use them? The link literally starts with "This document explains the usage ofDjango’s authentication system in its default configuration" so it seemslike an obvious place to look in order to figure out "how to use them".Have you tried reading the documentation?Kind regards,Kasper Laudrup --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/ab9cf185-708b-607e-5923-b98a1319e130%40stacktrace.dk.



-- 
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/140831652206599%40mail.yandex.com.


Re: Single user as a seller and buyer at the same time.

2022-05-10 Thread DJANGO DEVELOPER
yes. I went through the documentation but did not work on what I wanted to
achieve. I am totally lost

On Tue, May 10, 2022 at 5:05 PM Kasper Laudrup 
wrote:

> On 10/05/2022 11.53, DJANGO DEVELOPER wrote:
> > yes, I know. but how to use them?
> >
>
> The link literally starts with "This document explains the usage of
> Django’s authentication system in its default configuration" so it seems
> like an obvious place to look in order to figure out "how to use them".
>
> Have you tried reading the documentation?
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/ab9cf185-708b-607e-5923-b98a1319e130%40stacktrace.dk
> .
>

-- 
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/CAKPY9pkfi23fUwB1ri%3DtjwrwWdXXvK86TDJ9fb56%2B%3DE0OOjpgg%40mail.gmail.com.


Django Admin external script before save/delete

2022-05-10 Thread Thiago Luiz Parolin
Hello everyone,
I'm trying to run a script before saving and deleting objects in db
using django admin.
If the script fails, the action (save or delete) needs to be aborted
and we need to inform the user with a message.

In the django docs:

"...When overriding ModelAdmin.save_model()
andModelAdmin.delete_model(), your code should save/delete the object.
They are not for veto purposes, but allow you to perform extra operations..."

So using modelform I can make this work for save, but how can I make
it for delete (or delete_queryset) too?

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


Re: Images

2022-05-10 Thread Arshad Noman
You change the names of the pictures in the separate folder then copy them
in a static folder then change the picture file names in the template
folder then refresh then see pictures are new ones or not

On Mon, 9 May 2022 at 20:15, Aliya Janmohamed 
wrote:

> Hi
>
> It is still displaying the same image as above.
>
> On Sun, 8 May 2022 at 03:34, Arshad Noman  wrote:
>
>> First, you change the picture name and place it in the pictures folder
>> like static or media folder then change the picture name in templates where
>> you want the picture to be displayed
>>
>>
>> 
>>  Virus-free.
>> www.avast.com
>> 
>> <#m_-4392793013509788988_m_-8012441007838514003_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>> On Sun, 8 May 2022 at 03:37, Aliya Janmohamed <
>> aliya.janmohame...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I cannot load my images, this is what shows:
>>>
>>>
>>> --
>>> 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/2dc9f275-adcf-4a03-b8ed-db4aad8dfbc6n%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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/M5ZOBHwScMA/unsubscribe.
>> To unsubscribe from this group and all its topics, 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%2B0oV2hu4SW1VJc0H%3DEfCnBsXLts0K8y_T_C-jjdpE5754r90g%40mail.gmail.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/CALHQhB7p5fnh2PQRKZYx9rCt3ZgHyGazV41Px4gyqBZv%3DQZJJA%40mail.gmail.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/CA%2B0oV2iubvRi-GAdH5gx38hnTJzW41xt2CiMFXgieqQFUPATZQ%40mail.gmail.com.


Re: Single user as a seller and buyer at the same time.

2022-05-10 Thread Kasper Laudrup

On 10/05/2022 11.53, DJANGO DEVELOPER wrote:

yes, I know. but how to use them?



The link literally starts with "This document explains the usage of 
Django’s authentication system in its default configuration" so it seems 
like an obvious place to look in order to figure out "how to use them".


Have you tried reading the documentation?

Kind regards,

Kasper Laudrup

--
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/ab9cf185-708b-607e-5923-b98a1319e130%40stacktrace.dk.


Re: Single user as a seller and buyer at the same time.

2022-05-10 Thread DJANGO DEVELOPER
yes, I know. but how to use them?

On Tue, May 10, 2022 at 1:11 PM George Tantiras  wrote:

>
> What about Django permissions?
>
>  https://docs.djangoproject.com/en/4.0/topics/auth/default/
>
> A user can be related to many groups.
> 20:23, 9 May 2022, DJANGO DEVELOPER :
>
>
> https://stackoverflow.com/questions/72161764/how-to-make-a-user-act-as-a-seller-and-as-a-buyer-at-the-same-time-in-django
>
> I have posted my problem on StackOverflow. can anyone help me? thanks in
> advance
>
> --
> 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/CAKPY9p%3D%2BirhRbBaH%3DXi033FAX9EhQZVWJJ7fUP0c0HOn6pHsSQ%40mail.gmail.com
> 
> .
>
>
>
> --
> Sent from Yandex Mail for mobile
>
> --
> 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/1041181652170234%40sas1-229a7e5e75ed.qloud-c.yandex.net
> 
> .
>

-- 
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/CAKPY9p%3Du3Y3Ap6%3DkgeEDTcYHcCWsxuEjRTjSsnZRNtuiUWRxbg%40mail.gmail.com.


Re: Single user as a seller and buyer at the same time.

2022-05-10 Thread George Tantiras
What about Django permissions? https://docs.djangoproject.com/en/4.0/topics/auth/default/A user can be related to many groups.20:23, 9 May 2022, DJANGO DEVELOPER :https://stackoverflow.com/questions/72161764/how-to-make-a-user-act-as-a-seller-and-as-a-buyer-at-the-same-time-in-djangoI have posted my problem on StackOverflow. can anyone help me? thanks in advance



-- 
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/CAKPY9p%3D%2BirhRbBaH%3DXi033FAX9EhQZVWJJ7fUP0c0HOn6pHsSQ%40mail.gmail.com.
-- Sent from Yandex Mail for mobile



-- 
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/1041181652170234%40sas1-229a7e5e75ed.qloud-c.yandex.net.