show_hidden_initial is an undocumented API feature. It defaults to False.
Is the correct way to specify a field as hidden in Django to make that
attribute True in the form?
Thanks
Mike
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsu
Have a switch that is set to OFF by default (then your tests will switch to
using a mocked approach) and then have test that can only be be run with
direct access to the API if you deliberately set it ON.
No "accidents".
On Tuesday, 24 July 2018 04:21:07 UTC+2, Kum wrote:
>
> Is there a way to
Hello,
I am trying to use inspectdb to generate models for a legacy database. I
get the following error:
$ python custom_inspectdb.py
Traceback (most recent call last):
File "custom_inspectdb.py", line 8, in
Command().execute(table_name_filter=lambda table_name: table_name in
tables, da
Hi Archit,
On 2018-07-23 20:09, archit mehta wrote:
I have oraclejet frontend application and want to server that using
django, I did it with flask but don't know how to do with django.
Here is complete description of my problem Please go through it and
suggest some solution.
https://stac
*models.py*
class Post(models.Model):
title = models.CharField(max_length=200)
body = models.TextField()
user = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True,
null=True)
date = models.DateField(default=datetime.now, blank=True)
text_author = models.CharField(max_length
what version of django are you using?
On Tue, Jul 24, 2018 at 11:05 AM, dean raemaekers
wrote:
> Hello,
>
> I am trying to use inspectdb to generate models for a legacy database. I
> get the following error:
>
> $ python custom_inspectdb.py
>
> Traceback (most recent call last):
> File "custom
Hello guys
I'm using spyder it contain python 3.6 so how I can I install django
Please help me
On Tue 24 Jul, 2018 6:46 pm John Son, wrote:
> *models.py*
> class Post(models.Model):
> title = models.CharField(max_length=200)
> body = models.TextField()
> user = models.ForeignKey(
you need to set initial in admin.py for this field, check this example -
https://bitbucket.org/voron-raven/maps/src/004eaa07612fd44b398dfdc61b5f9cb29ad23668/core/admin.py#lines-39
if it's not admin page - you need to pass initial to your Model form -
https://docs.djangoproject.com/en/2.0/topics
Hey,
I am trying to solve following problem and I got stuck. Any help is
appreciated...
I have two models which represent a product and its parts.
class Product(models.Model):
name = models.CharField(max_length=200)
average_daily = models.FloatField(default=0)
average_monthly = models.Inte
With all respect to the other answers, they don't answer what you are
asking.
The documentation has you interacting with the shell because django uses a
database. In order to interact with the database you have to have an
instance of your app running - in this case via the shell. In a future
se
Thank you very much for the responses, everyone. Understanding *why* I've
been having to work in the shell makes a lot more sense. Currently, my
primary goal of learning Python is for web applications/websites, so I
definitely want to learn how to do it all in the code itself, but I'm sure
I'll
I think I am missing something here, but here it goes. I have a model, and
it is a sender for a post_save signal.
class Book(models.Model):
...
created_at = models.DateTimeField(default=timezone.now)
bought = models.BooleanField(default=False)
@receiver(post_save, sender=Book)
def cre
Hi there,
ideally I would like to run Daphne alongside Gunicorn and not Daphne alone:
- My chat with Daphne
- Rest of the website with Gunicorn
A user logs in - request via Gunicorn. Now when he connects with the chat I
get an AnonymousUser using self.scope['user']. This is a problem because I
I have the following:
In [39]: from django.db.models.functions import TruncDate
...: p = Purchase.objects \
...: .annotate(date=TruncDate('event_date')) \
...: .values('date') \
...: .annotate(total=Sum('quantity')) \
...: .order_by('event_date')
...:
.
Hi Dave,
It depends on what the protocol for the chat room is, but Channels is more
for hosting websocket-based applications than consuming them. I suspect you
would be better off looking at websocket client libraries, if the chat
socket is even accessible.
Andrew
On Mon, Jul 23, 2018 at 4:45 PM
Greetings ... I'm just starting out...
I am trying to install ‘virtualenv’ on my windows 8 laptop so I can use a
tutorial to learn DJANGO.
I’ve spent about 2 days trying alternatives… desperate for help… thanks
I’ve tried using pip in many variations… I ALWAYS get the error message:
For future reference - I had to change my function to
def get_po_number():
last_po = PurchaseOrder.objects.order_by('po_number').last()
if last_po:
last_po_num = last_po.po_number
new_po_num = last_po_num + 1
else:
new_po_num = '1'
po_number = new_po_num
$ python -m django --version showing syntax error? also i am unable to
create a file.. i am using python 3.7 and django is already installed in my
system, version of django is 2.0.7(which is compatible with python 3.7
--
You received this message because you are subscribed to the Google Groups
Sorry to bother you. Just discovered the HiddenInput widget.
M
On 24/07/2018 5:40 PM, Mike Dewhirst wrote:
show_hidden_initial is an undocumented API feature. It defaults to False.
Is the correct way to specify a field as hidden in Django to make that
attribute True in the form?
Thanks
Mik
Is there a prescribed pattern to optimize Prefetches when the expected
Prefetch list is known to exceed 100 ? We are on Django 1.8 + Postgres 10.
PG has a limit of 100 for values in IN queries after which the Index on the
said column is not used. For ex: a typical Prefetch generating an IN query
I am trying to follow the latest Django tutorial at the documentation and I
faced the following error when I enter python manage.py makemigrations polls
Traceback (most recent call last): File "manage.py", line 15, in
execute_from_command_line(sys.argv) File
"C:\Users\asus\AppData\Local\Program
There is no such config, but you can make it through socket interface
mocking
https://stackoverflow.com/questions/18601828/python-block-network-connections-for-testing-purposes
You can also split all tests into two groups:
- unit tests - should run without internet and all required requests shou
22 matches
Mail list logo