Image Fetching

2022-10-23 Thread Chukwudi Onwusa
I am only being able to fetch image registered only through the admin on
browser user interface. But the one I registered on browser user interface,
whenever I try fetching it through the user interface, it only shows image
icon, but if I upon the image in the admin interface it shows me error like
the one below.
But the one registered through the admin interface has no error, I have
done all the do-ables , but yet no positive results

-- 
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/CAGoV8nmhGrgGh44z6kUHDHrLo7xRfct%2Bzr07kYb0mmFHLkVuGA%40mail.gmail.com.


Image Fetching

2022-10-23 Thread Chukwudi Onwusa
I am only being able to fetch image registered only through the admin on
browser user interface. But the one I registered on browser user interface,
whenever I try fetching it through the user interface, it only shows image
icon, but if I upon the image in the admin interface it shows me error like
the one below.
But the one registered through the admin interface has no error, I have
done all the do-ables , but yet no positive results

-- 
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/CAGoV8n%3DvD0pT2LTBvRcyJZSt-zaMeNg8EKFSR7ThaRBYyh_nUA%40mail.gmail.com.


CRUD Operation

2022-10-23 Thread Chukwudi Onwusa
Please, what can I do to retrieve my already entered date and select option
during my process of editing details on browser user interface not admin, I
used value= instance of the class.  Date variable name, but it not working

-- 
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/CAGoV8nnrVLm6iOUUkYZREVgYDQ9ER4S6MDawVDeozOHAo7Vrvw%40mail.gmail.com.


Re: request to post UnboundLocalError

2022-10-23 Thread Jitendra kumar Patra
Declare the contact variable before the return statement

On Mon, 24 Oct, 2022, 00:52 Deepak kumar,  wrote:

> please check to pdf and send to my email dk9284...@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/ce32825e-f275-4735-af27-6626e19f60ban%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/CAOAROfmd65WqGZVtGh2MPsa0q1G5rC9BAP%2BnL%3DSNgROR9%3DaMww%40mail.gmail.com.


Sanity check please

2022-10-23 Thread Mike Dewhirst
In the Django Admin I have a model central to a bunch of FKs and M:Ms 
plus a lot of processing on saving.


This is my solution which seems to work but frightens me a bit.

class Chemical(models.Model):

    # lots of fields

    def save(self, *args, **kwargs):

    self.process_stuff_based_on_field_values_pre_save()

        first = False

        if not self.id:

    first = True

    super().save(force_insert=True, *args, **kwargs)

    if self.id:

            self.create_or_update_a_bunch_of_related_records(first=first)

    super().save(force_insert=False, *args, **kwargs)

    self.create_or_update_a_bunch_of_m2m_records(first=first)

def process_stuff_based_on_field_values_pre_save(self, first=False):
...



def create_or_update_a_bunch_of_m2m_records(self, first=False):
...


    # lots of other methods

Thanks for any warnings, caveats

Cheers

Mike

--
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. Just
ask and I'll send it to you. 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/a9164eef-3297-d6ac-e126-aad62d7e7488%40dewhirst.com.au.


OpenPGP_signature
Description: OpenPGP digital signature