All Tickets

Priority
Status
Type
Category
Anonymous
asked 3 years, 6 months ago
Views 1546
Views 1546

app.models.py

class ColorSet(models.Model):
    color = models.CharField(max_length=50, verbose_name='Color', default='', blank=True, null=True)
    code = models.CharField(max_length=50, verbose_name='Code of color', default='', blank=True, null=True)

    class …
Django
Medium
Problem
Closed
Anonymous
asked 3 years, 6 months ago
Views 1663
Views 1663

My urlpatterns :

urlpatterns = [
    re_path(r'^dj-admin/', admin.site.urls),
    re_path(r'^admin/', include(wagtailadmin_urls)),
    re_path(r'^docs/', include(wagtaildocs_urls)),

    i18n_patterns(
        path(r'', include(wagtail_urls)),
        prefix_default_language = False
    )
] …
Django
Low
Problem
Closed
Anonymous
asked 3 years, 6 months ago
Views 378
Views 378

Viewed 15k times

In the following django model:

class MyModel(models.Model):
    published = models.BooleanField(default=False)
    pub_date = models.DateTimeField('date published')

I want the pub_date …

Django
Low
Problem
Closed
Anonymous
asked 3 years, 6 months ago
Views 531
Views 531

Trying to start a webpage using the Django framework. 

After creating the project, I tried to start an app that …

Django
Medium
Problem
Closed
Anonymous
asked 3 years, 6 months ago
Views 732
Views 732

After updating a Django 1.7 project to Django 1.8 and now get errors when I run the tests (that are …

Django
Medium
Problem
Closed
Anonymous
asked 3 years, 6 months ago
Views 262
Views 262

In a Django project where I need to create a form for inputs. I tried to import reverse from django.core.urlresolvers …

Python
Medium
Problem
Closed
me
asked 3 years, 6 months ago
Views 787
$10
Views 787

Hi everyone,

I have a simple form with checkboxes and a submit button upon clicking, the results show up fine …

Django
Urgent
Problem
Closed
Soudhamini
asked 3 years, 6 months ago
Views 212
Views 212
Java
Medium
Question
Closed
Star
asked 3 years, 6 months ago
Views 213
Views 213

 I tried this code extend method , some how my code is not working

my_array = array('i', [1,2,3,4,5]) 
my_extnd_array = …
Python
Low
Question
Closed
Star
asked 3 years, 6 months ago
Views 226
Views 226

can any one explain details . could you please help me

Python
Low
Question
Closed
Soudhamini
asked 3 years, 6 months ago
Views 228
Views 228

I want to know what is different between these abstract class and interface...

Answer  from anyone will help me a …

Java
Medium
Question
Closed
Soudhamini
asked 3 years, 6 months ago
Views 205
$5
Views 205

Consider two lists like:

L1=[13,12,0,29,5]
L2=[19,23,1,29,10]

Now I want the output as:

L3=[(13,19),(12,23),(0,1),(29,29),(5,10)]

How can I get that........

Python
High
Problem
Closed
Soudhamini
asked 3 years, 6 months ago
Views 246
Views 246
Python
Low
Question
Closed
Soudhamini
asked 3 years, 6 months ago
Views 208
Views 208
public class Main
{
	public static void main(String[] args) {for (int i=0; i<6; i++)
  {
  for (int j=0; j<i; j++) …
Java
Medium
Task
Closed
Vengat
asked 3 years, 6 months ago
Views 267
Views 267

I have a requirement to read the 

{{ request.user.username }}

in Javascript to pass the value to Django backend. But …

Django
Medium
Question
Closed
Soudhamini
asked 3 years, 6 months ago
Views 243
Views 243
<span style="background-colour:red; @media (max-width:300px){background-colour:yellow;}"></span>

Is this possible?

Help me out.......

CSS
Medium
Question
Closed
Soudhamini
asked 3 years, 6 months ago
Views 227
$5
Views 227

I have the following code:

class ClassA(object):
    def __init__(self):
        self.var1 = 5
        self.var2 = 2

    def methodA(self):
        self.var1 = self.var1 …
Python
High
Question
Closed
p789ahm
asked 3 years, 6 months ago
Views 259
Views 259

I have a python function that I want to check if a certain field is present in the json that …

Python
Low
Question
Closed
Soudhamini
asked 3 years, 6 months ago
Views 201
Views 201
l1=[20,30,10.5]

I have the following list I want the output as:

[30,40,20.5]

I want the most efficient way of answer

Python
Medium
Problem
Closed
Soudhamini
asked 3 years, 6 months ago
Views 1079
Views 1079
s = [1,20, 67, 21, 56, 13]
print(*s, sep = '\n')

this is the list I have 

I want this …

Python
Low
Problem
Closed
Soudhamini
asked 3 years, 7 months ago
Views 217
Views 217

I have the following code

def fun1(par):
    print('Hi this is a function without filling the parameter')
    return True

fun1()

And …

Python
Medium
Question
Closed
Soudhamini
asked 3 years, 7 months ago
Views 240
Views 240
def isPrime(x):
    if x > 1:
        for i in range(2, x):
            if x % i == 0:
                return False

        return …
Python
Medium
Problem
Closed
ashutoshmishra333
asked 3 years, 7 months ago
Views 232
Views 232

Suppose there are 7 choices ,e.g 7 days

I want all the name of 7 days in a list

I …

Django
Medium
Task
Closed
Vengat
asked 3 years, 7 months ago
Views 254
Views 254

I am facing some challenge to formatting the Float data type in Postgresql DB.

I have order table after I …

Postgresql
Medium
Problem
Closed
Soudhamini
asked 3 years, 7 months ago
Views 189
Views 189

I have a list of characters like 

a = ['he','ll','o','  ','good','mo','rni','n','g']

I want te final output as

hello  goodmorning

could …

Python
Low
Problem
Closed
Vengat
asked 3 years, 7 months ago
Views 285
Views 285

I am trying to pass the CHOICE field value in Django Template in a tag, like below,

<a href="{% url …
Django
Medium
Problem
Closed
meena
asked 3 years, 7 months ago
Views 903
Views 903

I require to sftp files from one linux server to another using password authentication. I need to call this script …

Unix
Medium
Question
Closed
ashutoshmishra333
asked 3 years, 7 months ago
Views 379
$5
Views 379

How to delete token of the recently logged in user.

#models.py

class MyUserManager(BaseUserManager):

def create_user(self, email, password=None, **extra_fields):

if not …

Django
High
Question
Closed
Anonymous
asked 3 years, 7 months ago
Views 529
Views 529

I have a small Django app with a form, wich saves some data to the DB.

Here's the form:

class …
Django
Medium
Question
Closed
Anonymous
asked 3 years, 7 months ago
Views 4376
Views 4376

I am using openpyxl library to write in existing Excel file in separate cells.

How do I write some text …

Python
Low
Question
Closed
Anonymous
asked 3 years, 7 months ago
Views 247
Views 247

I have this function that I want to read a single byte from a large file. The only problem is …

Python
Medium
Question
Closed
Anonymous
asked 3 years, 7 months ago
Views 296
Views 296

I am new to DRF and I am having trouble with overriding its methods.

I would like to allow a …

Django
Medium
Question
Closed
Anonymous
asked 3 years, 7 months ago
Views 1137
Views 1137

I'm succeeded logging in sites using Selenium in Python 3.4 The login process is like below:

browser = webdriver.PhantomJS()
browser.get('url') …
Python
Medium
Question
Closed
Anonymous
asked 3 years, 7 months ago
Views 231
Views 231

Background:

I'm using py.test together with pytest-selenium, now I would like to take a screenshot of page when assertion fails. …

Python
Low
Question
Closed
Anonymous
asked 3 years, 7 months ago
Views 446
Views 446

Using https://github.com/jpwatts/django-positions,

I have a few models that inherit from a parent one, for example:

class ContentItem(models.Model):

    class Meta: …
Django
Medium
Question
Closed
Anonymous
asked 3 years, 7 months ago
Views 1524
Views 1524

I have admin view with tabular inline:

class AddressInline(admin.TabularInline):
    model = Address
    can_delete = False
    readonly_fields = ['kind']
    max_num = …
Django
Medium
Question
Closed
Anonymous
asked 3 years, 7 months ago
Views 221
Views 221

I'm writing data to a CSV file, then once that's done, I copy the file to another directory.

This is …

Python
Medium
Question
Closed
Anonymous
asked 3 years, 7 months ago
Views 260
Views 260

is there an older version of pip that doesn't check SSL certificates?

my corporate proxy replaces the cert from pypi …

Python
Low
Question
Closed
Anonymous
asked 3 years, 7 months ago
Views 235
Views 235

I'm writing a library in Python which makes calls to a REST API, receives results in JSON, and returns Python …

Python
Medium
Question
Closed
Vengat
asked 3 years, 7 months ago
Views 208
Views 208

I have added the logo for my website as a title one.

So I have used link shortcut icon set …

Html
Low
Problem
Closed
Soudhamini
asked 3 years, 7 months ago
Views 212
Views 212

I have two lists

​
L1=['NAME','AGE','EMAIL','GENDER']
L2=['SOUMYA','22','soumya22@gmail.com','female']

​

I want the output as :

{'NAME':'SOUMYA','AGE':'22','EMAIL':'soumya22@gmail.com','GENDER':'FEMALE'}

Python
Low
Problem
Closed
bhanupriyakuchana123
asked 3 years, 7 months ago
Views 429
Views 429

I'm tyring to test the Python Selenium and I have this code:

from selenium import webdriver
url = 'https://www.youtube.com/channel/UC8tgRQ7DOzAbn9L7zDL8mLg/videos'
driver …
Python
Medium
Problem
Closed
Soudhamini
asked 3 years, 7 months ago
Views 203
Views 203

I want a function like

​
d = dict(p1=1, p2=2)
def f2(p1, p2):
    print(p1, p2)
f2(d)

​

which returns output …

Python
Medium
Task
Closed
Soudhamini
asked 3 years, 7 months ago
Views 214
Views 214

I want a code which compares multiple integer values for one value and therefore it returns a list as an output …

Python
Medium
Problem
Closed
Anonymous
asked 3 years, 7 months ago
Views 238
Views 238

[....'1', '2937', '0', '0', 'Sep 10 20:34:44 2020', 'Sep 10 20:35:41 2020', '1', '2978', '0', '0', 'Sep 10 20:34:44 2020', …

Python
Medium
Problem
Closed
Anonymous
asked 3 years, 7 months ago
Views 1577
Views 1577

I check my code using mypy. I got these errors:

  1. I have an object names: List[str], for len(names) …

Python
Medium
Problem
Closed
Anonymous
asked 3 years, 7 months ago
Views 258
Views 258

I have a dataframe with the patient's diagnosis in a column and using pandas I want to dichotomize the diagnosis …

Python
Medium
Question
Closed
Anonymous
asked 3 years, 7 months ago
Views 219
Views 219

In the df underneath, I want to sort the values of column 'cdf_X' based on column 'A' and 'X'. Column …

Python
Medium
Problem
Closed
Anonymous
asked 3 years, 7 months ago
Views 350
Views 350

I have a panel of stocks with these columns: Date, Ticker, Ret, MTB. I want to rank the stocks based …

Python
Medium
Problem
Closed
Anonymous
asked 3 years, 7 months ago
Views 208
Views 208

Given a list of instances of class A[A() for _ in range(5)], I want to randomly select …

Python
Medium
Problem
Closed
First Previous 3 4 5 6 7 Next Last