Re: How to add object to users unique list?

2022-03-01 Thread David Crandell
Hello. You need a corresponding URL for your link that's why you're getting reverse error: path('add/anime///', views.MYVIEW, name='url-to-my-view'> and then return redirect to your success_url after your enter the data, not return render. On Monday, February 28, 2022 at 12:00:19 PM UTC-6 alla

Re: Including URLconf

2022-03-07 Thread David Crandell
Do you have the app imported in the settings.py? Also try using the "app_name" var in each of your urls.py files. On Sunday, March 6, 2022 at 10:29:23 PM UTC-6 alec...@gmail.com wrote: > > if i try to migrate, this error pops up as well > On Sunday, March 6, 2022 at 6:24:44 PM UTC-6 Alec Greenho

Re: Including URLconf

2022-03-07 Thread David Crandell
That's definitely your problem. Include the app under INSTALLED_APPS - put "app_name.apps.AppNameConfig" with app_name being the name of your app. On Monday, March 7, 2022 at 11:35:40 AM UTC-6 alec...@gmail.com wrote: > this is the installed apps in settings.py I haven't touched it. i only did

Re: 'ascii' codec can't encode character

2022-04-29 Thread David Crandell
You'd actually want to handle UNICODE strings, not ASCII. https://docs.djangoproject.com/en/4.0/ref/unicode/ On Thursday, April 28, 2022 at 7:02:49 PM UTC-5 Thiago Luiz Parolin wrote: > Hi, > i have a model with 2 charfields for givenname, surname: > >nome = models.CharField( > max_l

migrations creating tables, but not creating columns

2021-06-11 Thread David Crandell
Hello - I'm moving from a more archaic platform and am still green to Django. I have created my models. The makemigrations runs and subsequently migrate completes. Then when I try to enter data in the shell, it says my column names do not exist. I added the classes to the admin.site.register([

getattr(): attribute name must be string

2021-06-11 Thread David Crandell
Hello, I am trying to migrate changes to my models. When I do, I get a traceback error to my Employee model which says Traceback (most recent call last): File "manage.py", line 22, in main() File "manage.py", line 18, in main execute_from_command_line(sys.argv) File "C:\Users\gu

Re: getattr(): attribute name must be string

2021-06-12 Thread David Crandell
It was a field type mismatch. I should have used DecimalField() instead of FloatField() On Saturday, June 12, 2021 at 12:08:56 AM UTC-5 David Crandell wrote: > Hello, > > I am trying to migrate changes to my models. When I do, I get a traceback > error to my Employee mode

How to insert into multiple tables cascading

2021-06-22 Thread David Crandell
Hello, I come from a platform where I built out forms and then manually wrote insert statements from the form input entering all the data at once. What I want to do is enter a customer (one table), have it populate a master region with the same name (another table), then fill out a master location

Re: How to insert into multiple tables cascading

2021-06-23 Thread David Crandell
web_address', 'notes', \ 'cust_classification', 'logo' class RegionWCust(forms.ModelForm): class Meta: model = CustomerRegions fields = ('region',) On Tuesday, June 22, 2021 at 9:47:26 PM UTC-5 abubak...@gmail.com wrote: > please share your related

Re: How to insert into multiple tables cascading

2021-06-23 Thread David Crandell
fault=None, null=True, blank=True) notes = models.TextField(help_text='Notes', null=True, blank=True, default=None) On Wednesday, June 23, 2021 at 8:34:07 AM UTC-5 David Crandell wrote: > Thank you for your reply. > > here are my models. Forms below. > > MODELS > >

Re: How to insert into multiple tables cascading

2021-06-23 Thread David Crandell
ws? if not then give a try to inlineformset_factory. because through > inlineformset_factory you can populate data of different models through a > single form. for now it looks a solution to me. > > On Wed, Jun 23, 2021 at 6:35 PM David Crandell > wrote: > >> Sorry customer

Related records on same page with DetailView

2021-06-23 Thread David Crandell
Hello, I just don't stop having problems LOL. All I want to do is display related Subcats on the detail page under the Category detail. Seems like the exact same thing as the Books/Publisher demo but I just can't get it to work. It keeps saying my field doesn't exist, or it pulls all the recor

Re: Django relationships

2021-06-25 Thread David Crandell
You'll have to define "in_use" as a models.BooleanField() I would have base class Devices and have Stock and Assign inherit from those On Thursday, June 24, 2021 at 4:24:22 PM UTC-5 murad...@gmail.com wrote: > Hi Django developers, > i am new in Python, > > i want to develop a simple app stock

Re: Django relationships

2021-06-25 Thread David Crandell
the way I manage my inventory system is keep all devices in one table and flag assigned or unassigned like you're trying to do. Each is then assigned to a locationID. On Thursday, June 24, 2021 at 4:24:22 PM UTC-5 murad...@gmail.com wrote: > Hi Django developers, > i am new in Python, > > i wan

Credentials fail from custom Auth backend

2021-07-03 Thread David Crandell
Hello, I am using a custom auth backend and everything displays properly, except I cannot login with the credentials in my model. I have spent 5 hours on this and cannot figure it out. Please help. views.py class MyLogin(LoginView): template_name = 'employees/login.html' form_class = LoginForm

Re: Email Form with attachments

2021-07-04 Thread David Crandell
Attachments need to be written to mail headers using MIME. This article gives a good breakdown https://stackoverflow.com/questions/1633109/creating-a-mime-email-template-with-images-to-send-with-python-django On Sunday, July 4, 2021 at 10:30:10 AM UTC-5 sebasti...@gmail.com wrote: > Hello, > >

Re: Credentials fail from custom Auth backend

2021-07-04 Thread David Crandell
There is no error. It just says invalid login. I get the login template and it rejects my credentials. David L. Crandell 469-585-5009 g uitard...@outlook.com guitardave8...@gmail.com da...@onholdwizard.com On Sun, Jul 4, 2021 at 9:15 PM ANi wrote: > What does the error message say? > guitard.

Re: Credentials fail from custom Auth backend

2021-07-05 Thread David Crandell
This is the message I get when I try to login "Please enter a correct email and password. Note that both fields may be case-sensitive." I've changed my code a little in an effort to try to remedy my situation. I'm really stuck on this. From what I can tell, it's passing the values to the authen

Re: Credentials fail from custom Auth backend

2021-07-05 Thread David Crandell
', None) return is_active or is_active is None def get_user(self, user_id): try: return Emp.objects.get(pk=user_id) except Emp.DoesNotExist: return None def has_perm(self, perm, obj=None): return True def has_module_perms(self, app_label): return True On Monday, July 5, 2021 at 12:09:17 PM

attribute has no file associated with it

2021-07-19 Thread David Crandell
This error keeps appearing when I try to update forms with image fields. When I try to upload images, the field containing the image says "[field] attribute has no file associated with it" I'm using model forms and generic update views. I don't know how to make the attribute have the file assoc

specify querysets in forms

2021-07-20 Thread David Crandell
Hello again. I know I'm posting in here all the time. I am trying to get specific querysets in my forms based on the id in the kwargs but it says there is a keyerror with 'id'. It's the same kwargs.get('id') I reference whenever I do other stuff. Not sure why it doesn't like it this time. Any s

Re: help me

2021-07-28 Thread David Crandell
Try deploying to a PaaS platform like Heroku or DigitalOceans Apps service. They can be very cost effective and are an excellent way to host a Django app. On Tuesday, July 27, 2021 at 11:26:13 AM UTC-5 kossit...@gmail.com wrote: > > I need a video who explains how to host a site on ionos > --

Re: Django Discord

2021-08-11 Thread David Crandell
Discord is its own API, programmable with Python or nodejs. Django is a python-based web application framework. The two aren't related except both are programmable with Python. On Tuesday, August 10, 2021 at 2:34:59 PM UTC-5 Lloyd wrote: > Hi everyone, > > Where can I find Django on Discord? >

Re: Error - module 'django.db.models' has no attribute 'FieldDoesNotExist' when adding FK relationship object

2021-08-11 Thread David Crandell
Try adding related_name='+' to your FK definition. class ReleaseImageGallery(BaseImageGallery): release = models.ForeignKey(Release, related_name='+', on_delete =models.CASCADE) class Meta: verbose_name = "release image gallery" verbose_name_plural = "release image galleries" On Friday, August 6

Re: View that displays my ManyToManyField('self'...) relations in a with levels

2021-08-19 Thread David Crandell
I would create two dictionaries, one for subassembly and one for component. then in your view, loop through the first group, pulling your data from a master dataset: assem = Assembly.objects.all() sa = assem.subassembly.all() comp = assem.component.all() send 'sa' and 'comp' to your template as

Writing migrations to wrong database entirely

2023-11-14 Thread David Crandell
Howdy, I have been working with Django for about three years now and have developed a couple business grade apps which are deployed and doing great. The other day, I created a new project with a new database, etc. I built out the initial mode

Re: Writing migrations to wrong database entirely

2023-11-14 Thread David Crandell
er 14, 2023 at 7:14:22 AM UTC-7 David Crandell wrote: > <https://stackoverflow.com/posts/77481255/timeline> > > Howdy, I have been working with Django for about three years now and have > developed a couple business grade apps which are deployed and doing great. > > The other