Re: TypeError at /register User() got unexpected keyword arguments: 'name1', 'name2', 'country'

2023-03-30 Thread Alex Sonar
Hi Ebenezer, Could I ask you to show the content of the model file, please?

On Thursday, March 30, 2023 at 5:21:06 AM UTC+3 Ebenezer Otchere wrote:

> I am trying to collect user information and save in my database but i keep 
> getting this error
> and i dont know the way around it so help me the codes and the error page 
> are below
> [image: Screenshot (3).png][image: Screenshot (4).png][image: Screenshot 
> (5).png] 
>

-- 
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/65480c4f-7d81-49ea-a735-4576a8315080n%40googlegroups.com.


The problem of versioning a large project.

2023-03-29 Thread Alex Sonar


The problem of versioning a large project.

Hi guys, I really got stuck with the challenge, with the design of 
versioning for a large project.

Now we have organized versioning, where our project is divided into 
separate GIT repositories which are created for each application.

The new necessity point is to split some of them for front-end and back-and 
developers.

The task looks like bad practice, where we have to create a repository 
within another one.

Or redesign the file structures of the application itself, to meet this 
requirement.

If someone has a similar challenge or practice and helps me make the right 
decision, I will be very grateful.

-- 
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/43b193b9-00f2-4fe5-963c-5770a41e7964n%40googlegroups.com.


Re: Dear participants of Django Users Group, could you take part in our survey, please?

2023-01-24 Thread Alex Sonar
Hey folks
When rushing with adding new features it is easy to forget something or 
loose the big picture.
Why not just ask what are the common issues that Django developers have 
faced?
Like most of the solutions we are searching for. Like: tons of filtering 
issues, queries and sub-queries, advanced search models, ORM-auto-generated 
staff related...ext
Ask about CBVs issues also
On Monday, January 23, 2023 at 3:52:09 PM UTC+3 oranged...@gmail.com wrote:

>
> We on the way to create new tools for Python developers, and to confirm 
> the functionality we develop, we created this survey. Django framework 
> survey 
> Helpfully your participation that we make useful things for the entire 
> Python community.
> This survey is addressed primarily to software development, business 
> owners, project managers, DevOps, stakeholders, a party that has an 
> interest in a company and can either affect or be affected by the 
> business. and owners of multiple disparate projects, using the Django 
> framework.
> Independent and team developers whose projects are implemented in Django.
>
> There are no product ads here and the purpose of this survey is only to 
> determine the relevance of the problems that developers most often face.
>

-- 
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/56af18b9-41e7-4908-90cc-1d0887974778n%40googlegroups.com.


Re: How to access the value of a field that failed validation

2023-01-02 Thread Alex Sonar
Hi Noel! 
Have you looked at the problem in context CSRF Protection?
Please check it out 

   - How to use Django’s CSRF protection   
   https://docs.djangoproject.com/en/4.1/howto/csrf/

It might be as a solution...
On Monday, January 2, 2023 at 3:27:01 AM UTC+3 Noel Duffy wrote:

> I'm new to Django, though not to programming. I'm using Django 4.1.4 on 
> AlmaLinux 9.
>
> My question is this. Is it possible to access a ModelForm field's value 
> if that form field failed validation?
>
> I'm writing a small ticketing system for a helpdesk to handle spam 
> reports. Users submit spam messages which the system will then process. 
> I'm using a ModelForm, and the database schema specifies that the spam 
> message is unique. That is, each spam message can be reported only once, 
> so there's just one ticket but possibly many different actions taken 
> depending on what's in the spam.
>
> This is the model:
>
> class AbuseReport(models.Model):
> report_date = models.DateTimeField(auto_now_add=True)
> report_subject = models.CharField(max_length=255)
> report_msgid = models.CharField(max_length=255, unique = True)
> report_spam_text = models.TextField(unique = True)
> def __str__(self):
> return report_subject
>
> class Meta:
> ordering = ['-report_date']
>
> Now, the problem is that a spam message will fail form validation in the 
> form.is_valid call if the spam message fails the "unique" constraint. 
> Why is this a problem? Because I want to get my hands on the spam 
> message if it's already in the DB so that instead of just re-showing my 
> form with an error message saying the spam already exists, I want to 
> redirect to the existing ticket. But so far I've not been able to figure 
> out how to do this, and when I dump the contents of the form in 
> debugging, the spam message just isn't there.
>
> I should add that the ModelForm only creates a field for the 
> report_spam_text field. I.e,
>
> class AbuseReportForm(ModelForm):
> def __init__(self, *args, **kwargs):
> super(ModelForm, self).__init__(*args, **kwargs)
>
> def clean(self):
> [...]
>
> class Meta:
> model = AbuseReport
> fields = ['report_spam_text']
> widgets = {'report_spam_text':
> Textarea(attrs={
> 'rows': 20,
> 'class':'textarea',
> 'placeholder':'Paste spam with full headers here..'
> }),}
>
>
> This is what my view looks like (stripped down for simplicity):
>
> def spamsubmit(request):
> # if this is a POST request we need to process the form data
> if request.method == 'POST':
> # create a form instance and populate it with data from the 
> request:
> form = AbuseReportForm(request.POST)
> # check whether it's valid:
> if form.is_valid():
> # process the data in form.cleaned_data as required
> [.]
> else:
> ## show the form again with errors displayed
> ## if spam already exists this is what gets run.
> return render(request, 'abuse/spam_form.html',{'form':form})
>
> As I understand it, fields aren't bound to data until is_valid is 
> called, and if is_valid fails then only fields that didn't fail validity 
> go into cleaned_data. But it seems everything else is lost. But I'm not 
> 100% sure about this and this is why I'm asking.
>
>
>
>

-- 
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/2bf8db16-56f7-44f4-bfda-fa9aea477a41n%40googlegroups.com.