Re: Trouble with Django Generic List view

2020-01-01 Thread Sam Hefer
; > > On Wednesday, January 1, 2020 at 5:02:13 PM UTC-5, Sam Hefer wrote: >> >> Hi, >> >> I'm having some issues with displaying a filtered list in a template. >> >> My View: >> >> class MyJobs(ListView): >> model = Job >>

Django Formset, how to define multiple many to many fields and create a formset

2020-01-03 Thread Sam Hefer
created = models.DateTimeField(default=now, blank=True) def __str__(self): return str(self.technician) def get_absolute_url(self): return reverse('jobs:detail', kwargs={'pk': self.pk}) Could someone show me how to define this relationship as well as

How to load an instance in class based views using form_valid

2020-01-12 Thread Sam Hefer
0 I'm trying to build a form that automatically fills some fields in a class based create view that lets logged in users create a Job. However, I can't seem to find the correct way of doing this for fields that aren't the user (eg. request.user). So the create view is trying to get a company_n

How to pass pk through URL to CreateView

2020-02-14 Thread Sam Hefer
=DatePicker) start_time = forms.TimeField(widget=TimePicker) end_time = forms.TimeField(widget=TimePicker) class Meta: model = JobDocket exclude = 'rate', 'created', 'technician', 'job', fields = ( 'site_equip

Re: Production deployments and Version Control for DJango projects

2020-02-14 Thread Sam Hefer
Bitbucket is great if you don’t like Git env. It has a great interface. Thanks, Sam > On 15/02/2020, at 4:34 PM, Ram wrote: > >  > Hi, > > I'm currently having development server with Digital Ocean for our Django > based web site. We are currently copying ne

Re: How to pass pk through URL to CreateView

2020-02-18 Thread Sam Hefer
Hi Phil, I did find a solution to my query. Have a look at my post on stackoverflow: https://stackoverflow.com/a/60273100/7063031 Thanks, Sam > On 19/02/2020, at 3:21 AM, Phil Kauffman wrote: > >  > Hello, > > Did you get any headway on this issue? I'm a nov

passing a parameter through CreateView to a be an initial value in a form

2020-02-19 Thread Sam Hefer
Hey Patric, Have a look at stackoverflow. https://stackoverflow.com/a/60273100/7063031 I used form_valid in the createview to get the form instance field, passed the pk through the URL to the template, then used get_context in the view so the template can get the pk from the URL. You’ll unde

Re: Postgres failure when trying to remove check constraint

2024-10-05 Thread Sam Brown
For this exact reason I always use `sqlmigrate` to get the auto generated sql statement (and the backwards sql) and put this statements in `forwards` and `backwards` functions. I then separate the db and state operations. I bet if you run `python manage.py sqlmigrate ` on the migrations that rem

Re: ORM Bug from extending the `Query` class

2024-10-16 Thread Sam Brown
This won’t solve your problem but tangentially I’ve made a custom field lookup for `relatedfield__neq=objectToExclude` See: https://docs.djangoproject.com/en/5.1/howto/custom-lookups/ On Tue, Oct 15, 2024 at 3:59 PM Ben Pearman wrote: > Hi all, > > We wrote some custom logic that extended the `

Re: Django security releases issued: 5.1.4, 5.0.10, and 4.2.17

2024-12-04 Thread Sam Brown
Heads up, I’m getting a bad link error. Anyone else? On Wed, Dec 4, 2024 at 9:37 AM Sarah Boyce wrote: > Details are available on the Django project weblog: > https://www.djangoproject.com/weblog/2024/dec/04/security-releases/ > > -- > You received this message because you are subscribed to the

Re: Navbar

2023-05-18 Thread tintu john sam
you have add the css and js links to your main html file.. On Thu, May 18, 2023 at 11:44 AM Michael Edet wrote: > Please help > > On Sun, 14 May 2023, 18:17 Michael Edet, wrote: > >> I have been having issues with my navbar and I'm using bootstrap >> >> The first one is what I want >> The secon

<    1   2   3   4   5   6