Custom Django Admin Pages

2018-08-20 Thread 'Kyle Mulka' via Django users
Hi there,

It seems like Django Admin is designed to work with Django models. But, I'm 
wondering what the best way is to create custom admin pages that don't 
revolve around Django models. Like, maybe there's a third party API that I 
want admins to be able to call from the Django admin. What's the best way 
to get custom pages to show up and render in the Django admin?

Thanks,

Kyle

-- 
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/57ccf869-829c-4ed4-881b-3b2031834bee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Zero Downtime Field Type Changes

2019-03-12 Thread 'Kyle Mulka' via Django users
Hi there,

Wondering if there's any tool out there to make a zero downtime field type 
change easier. I want to change a django model field from one type to 
another, and the format of the field in the database is slightly different.

I've come up with a process I think will work, but it will be rather 
tedious if done manually. Wondering if there's a more automated approach or 
other tools out there already. I'd like to come up with a general solution 
for use in the future, but right now trying to tackle converting UUIDField 
from django-extensions to the built in django version.
https://github.com/django-extensions/django-extensions/issues/647

I was thinking about maybe using a custom field that supports both types, 
but not exactly sure how to write a custom field that would do that.

If it helps, the manual process I'm thinking about kind of goes as follows:

# existing model:
class Model:
field = OldField()

# add field_old with OldField type
# when updating or adding rows start writing to both fields
# copy data from field to field_old
class Model:
field = OldField()
field_old = OldField()

# stop using field, only use field_old
# remove field
class Model:
field_old = OldField()

# create field with new type
# when updating or adding rows start writing to both fields in their 
respective formats
# copy data from field_old in old format to field in new format
class Model:
field = NewField()
field_old = OldField()

# stop using field_old
# remove field_old
class Model:
field = NewField()

Thanks for your help!

--
Kyle Mulka
http://www.kylemulka.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 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/b16ffdee-74d6-4ba2-ac1f-b5bd9cf1e40b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Prefetch and custom managers

2019-04-08 Thread 'Kyle Mulka' via Django users
Hello,

I'm having an issue with trying to use prefetch and custom managers 
together. They seem to be interacting in a weird way. Wondering if I'm 
doing something wrong.

I've set up a test django project which demonstrates the issue here:
https://github.com/mulka/django_prefetch_manager_bug

These two tests are coming back with different results:
https://github.com/mulka/django_prefetch_manager_bug/blob/master/review_site/tests.py

Here's the models file:
https://github.com/mulka/django_prefetch_manager_bug/blob/master/review_site/models.py

Thanks in advance for your help!

-Kyle

-- 
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/2f946ab2-620c-49a0-a3cc-55b69e5a7e7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.