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 `
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
Im sure there are performance metrics out there to prove the ORM will not
be the bottleneck. But I’ve never seen it slow things down when I’ve
employed a timer on operation
Also, ive recently ran into some of the limitations of drf and am looking
into moving to an api that can be less coupled with
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
How can i connect employee.db file to django?
can any1 please help or share any tutorial
--
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...
ate.
Does anyone know of a non-form helper like as_p?
Same question posted on stackoverflow here
<https://stackoverflow.com/questions/74790679/django-as-p-method-equivalent-for-non-form-display-only-use-cases>
Thanks,
Sam Brown
--
You received this message because you are subscribed to t
Yes you can
What’s your model look like ?
On Sun, Jan 30, 2022 at 7:26 AM narendra...@gmail.com <
narendrathapa...@gmail.com> wrote:
> hello folks,
> any django ex[ert here, I want to know if anybody can do multiple join
> more than 5 tables at once using ORM
> Prefetch,prefetch_related,select_
You can use sets
On Tue, Jan 25, 2022 at 7:47 AM bnmng wrote:
> Hello,
>
> Is there a built in function that compares two or more lists and returns
> elements common to all?
>
> like this:
>
> def in_both( list_a, list_b ):
> list_c=[]
> for value in list_a:
> if value in list_b:
> list_c.append
Django gives you a builtin admin panel for free.
Enjoy
On Mon, Jun 28, 2021 at 3:49 PM Boris Pérez wrote:
> Hi friend...u can do everything u need in django...without use php...
> Greetings
>
>
> 2021-06-28 10:23 GMT-04:00, Luis Zárate :
> > Hi, you can create several web applications with Djan
Using django rest framework, create a serializer class and specify the
right field you want to display at the end.
Please check this link
https://www.django-rest-framework.org/api-guide/serializers/
On Sun, May 30, 2021 at 10:03 PM Mottaz Hegaze wrote:
> Using Django Rest Framework , you can
ch I am trying to extract via the
filter).
Is there a way to achieve ForeignObject type functionality but with many to
many relationships?
Any help would be greatly appreciated. Thanks!
-Sam
--
You received this message because you are subscribed to the Google Groups
"Django users&quo
plish?
>
> You can call management commands from inside django - but it doesn't
> really make any sense to do so. Especially the migrate command?
>
> So what is it you want to do? Then perhaps we can help you with a solution?
>
> Regards,
>
> Andréas
>
>
>
hi all
How to use django terminal codes inside your project code
example : " python manage.py migrate " code run inside views.py , not terminal
thanks
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop
hi all
How to use Digingo terminal codes inside your project code?
example : "python manage.py migrate" code run inside views.py ,not
terminal?
thanks
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop rece
Install pymongo package by > pip install pymongo
or, better practice
make a virtual environment directory where all your dependencies will be
installed.
> python -m venv myvenv (assuming you name it myvenv)
If you are in Windows
activate virtual environment with:
> cd in directory where
Hi Johnson,
i am also a django beginner who is looking for a website
development project. if you are interested, then we can start a project and
update our knowledge.
Thank you and looking forward to hear from you.
Sam
On Wed, Mar 11, 2020 at 10:28 AM Johnson wrote:
> Hi friends, I'm
I have 3 models. Question, Choice, and ChoiceColor.
class Question(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
question= models.CharField(max_length=200)
class Choice(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASCADE)
choic
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
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
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
=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
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
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
;
>
> 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
>>
ly lists two objects (for
all users) and the field reference doesn't show anything (jobs.company_name
is always empty).
Have I missed something?
Thanks,
Sam
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this
I'm sorry. But knowing Python alone is not enough.
I know Python and Django really well, still can't find a job for more than six
months.
You need to know Solid Python programming, python framework (Django (DRF) &
Flask), Docker and Kubernetes, AWS or Azure, Front-end development (React
Add it to the installed apps
INSTALLED_APPS = (
...
'tinymce',
)
--
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.
Did you add 'corsheaders', to the settings file?
The Error is very clear:
*npm ERR! frontend@1.0.0 dev: `cross-env NODE_ENV=development
webpack-dev-server --open --hot`*
Install : pip install django-cors-headers
Then add: 'corsheaders',to the INSTALLED_APPS inside settings file
in Django ser
Did you add 'corsheaders', to the settings file?
Follow this link: https://pypi.org/project/django-cors-headers/
On Thursday, August 1, 2019 at 10:18:11 PM UTC-5, Pradeep Singh wrote:
>
> F:\django-vue project\djangoVueProject\frontend\webpack.config.js:81
> 'vue$': 'vue/dist/vue.esm.js'
>
Use Javascript or jQuery
check out this link:
https://simpleisbetterthancomplex.com/tutorial/2016/11/22/django-multiple-file-upload-using-ajax.html
*10 jQuery File Upload Plugins:*
https://www.sitepoint.com/10-jquery-file-uploads/
On Friday, August 2, 2019 at 10:00:44 AM UTC-5, Django Dojo wrote
*Udemy *
The Complete Guide to Django REST Framework and Vue JS
https://www.udemy.com/the-complete-guide-to-django-rest-framework-and-vue-js/
On Thursday, August 1, 2019 at 2:46:10 AM UTC-5, Pradeep Singh wrote:
>
> can anyone sugget me django-vue tutorial
>
--
You received this message becau
Use IP2LOCATION to detect the location of the user IP address then you can
show pages based on it
On Monday, July 29, 2019 at 8:07:07 PM UTC-5, Sebastian Jung wrote:
>
> Hello,
>
> I want that my Website only German user can Open it and another User from
> Others Region a template Show, that t
Hi everyone,
I know there are currently 3 ways to define a model in Django
1) Define it directly in the models.py file
2) Define it directly in a models package in the same directory as your
other app files
3) Define it somewhere completely different and just import the models into
the models.py
This is the official page. It is really simple to follow:
https://docs.djangoproject.com/en/2.2/topics/auth/default/
On Wednesday, July 24, 2019 at 5:27:37 AM UTC-5, Soumen Khatua wrote:
>
> Hi Folks,
> I want to create one signup page where end-user can SignUp and LogIn by
> using their e-mail
Check this one out: Django Authentication with just an email and password
(no username required!)
https://medium.com/@ramykhuffash/django-authentication-with-just-an-email-and-password-no-username-required-33e47976b517
On Wednesday, July 24, 2019 at 5:27:37 AM UTC-5, Soumen Khatua wrote:
>
> Hi
*Use Django REST framework for Django and Vue.axios for vuejs*
*Example: *
https://medium.com/@jrmybrcf/how-to-build-a-project-with-django-vuejs-create-a-rest-api-endpoint-b57374a89661
On Monday, July 15, 2019 at 12:10:48 AM UTC-5, Pradeep Singh wrote:
>
> can anyone tell me how to integrate vu
I think think the first advice is way off base in two ways.
1) It's not clumsy to have 8 apps if that is the the structure of the
project that makes each part encapsulated and reusable.
2) 30 concurrent users in one app can be more demanding than 1000 in
another. It really depends on what each us
el like you are
still up to the task, then continue to stretch yourself by building bigger
applications till you feel comfortable to come back and contribute.
I feel like Django is the best place to start, considering it will be the
framework you will have the most experience with till date.
Kind
Yes long time ago ..
follow this tutorial
https://simpleisbetterthancomplex.com/tutorial/2016/11/22/django-multiple-file-upload-using-ajax.html
On Monday, May 13, 2019 at 10:00:24 AM UTC-5, christophe szczepanski wrote:
>
> *do solved your problem ? , i have the same ?*
>
>
> *Thank you :)*
>
--
Use java then use py4j or Jython to call java method...
https://www.baeldung.com/pdf-conversions-java
On Fri, Apr 19, 2019, 1:11 PM Irfan Khan wrote:
> hi,
> i stucked in converting the pdf file from html
> can an one suggest me even any other possibility instead of using python
> library
I want to upload multiple files to the system (Local folder) without using
Django forms or models. For a single file, everything works just fine and
the file get saved to a local media folder under the project. But when I
changed the function from {request.FILES['images'] } To
{request.FILES.ge
This one is very simple:
https://www.pushbots.help/install-pushbots-in-your-app-or-website/web-pages/add-pushbots-to-your-web-page
On Monday, March 25, 2019 at 11:28:43 AM UTC-5, Aayush Bhattarai wrote:
>
> *I am working on blog project and I wanted to add Web Push Notification in
> Django. I ha
Similar question in Stackoverflow:
https://stackoverflow.com/questions/24791110/django-allauth-how-to-set-user-to-active-only-after-e-mail-verification/24809190
On Monday, March 25, 2019 at 4:17:11 AM UTC-5, shubham joshi wrote:
>
> How can I create sign up form in such a way that..once a form h
Web Push Notification Package for Django:
https://github.com/safwanrahman/django-webpush
On Monday, March 25, 2019 at 11:28:43 AM UTC-5, Aayush Bhattarai wrote:
>
> *I am working on blog project and I wanted to add Web Push Notification in
> Django. I have researched a lot. I have not found prop
Similar question in Stackoverflow:
https://stackoverflow.com/questions/24791110/django-allauth-how-to-set-user-to-active-only-after-e-mail-verification/24809190
On Monday, March 25, 2019 at 7:52:57 AM UTC-5, Shubham Joshi wrote:
>
> How can I create sign up form in such a way that..once a form h
closing a tab will not log you out
>> also it depends on the browser (firefox seemed in the past to ignore this)
>>
>> On Thu, 21 Mar 2019 at 05:34, Sam W >
>> wrote:
>>
>>> Is there a way in Django to log out a user when user closes tab or
>>>
AT_BROWSER_CLOSE works for me
> but only when you close the browswer, closing a tab will not log you out
> also it depends on the browser (firefox seemed in the past to ignore this)
>
> On Thu, 21 Mar 2019 at 05:34, Sam W >
> wrote:
>
>> Is there a way in Django to log out
Is there a way in Django to log out a user when user closes tab or browser?
This one "SESSION_EXPIRE_AT_BROWSER_CLOSE =True" Doesn't work
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails
I'm not sure, but it looks like you are trying to connect to a localhost
which is fine locally but not in production. You probably need to change
your frontend code to route properly. This is all speculation as you have
not shown your application code, I don't think you'll get many good
answers...
Make sure your virtual environment is activated, you have to activate it
each time you create a new terminal.
Also contrary to what someone else said, you can use django-admin anywhere,
while you must be in the correct directory to run the manage.py file
On Sun, Mar 10, 2019, 07:38 abel otugeme
I would be careful how you pass the data on get, somewhere in your front
end code you are probably not passing the data through as you expected.
Instead of using .GET, use .GET.get to get your data. This will either
return the value you want, or none. I think you have made the error of not
passing
Why don't you use Django REST framework ?
Try this :
How to Integrate Vue.js with Django Rest Framework?
https://www.techiediaries.com/django-rest-vuejs/
On Friday, March 1, 2019 at 11:36:37 AM UTC-6, Tomas Garijo wrote:
>
> Hello group,
>
> I have a huge problems to integrate a vue javascript f
Why don't you use Django REST framework ?
On Friday, March 1, 2019 at 11:36:37 AM UTC-6, Tomas Garijo wrote:
>
> Hello group,
>
> I have a huge problems to integrate a vue javascript file in one template,
> only for testing, I'm searching on google but unfortuny I can't find anything.
> I have a
The error is very clear "IndentationError: expected an indented block" Use
PyCharm IDE OR Visual Studio Code.
Also, never use Keyboard Spacebar for indentation , always use Tab for
indentation. TO solve your problem take the question_text to the beginning
of the line then hit the Tab once.
O
This YouTube Channel is really good Taught by Corey Schafer
https://www.youtube.com/watch?v=UmljXZIypDc
Python Django Tutorial: It has more than 17 videos about Django.
On Thursday, February 28, 2019 at 12:54:06 PM UTC-6, Madhav Rajmohan wrote:
>
> Friends,
> I am Madhav Rajmohan
What validation does he specifically need? He could probably get away with
writing a few helper functions himself!
On Tue, Feb 5, 2019, 17:50 Miguel Ángel Cumpa Ascuña <
miguel.cumpa.asc...@gmail.com wrote:
> Django tastypie
> good luck!
> https://django-tastypie.readthedocs.io/en/latest/toc.html
I am trying to follow the 4 part channels tutorial, however I am getting an
error on the last part where we run selenium to test against a live server.
It's not the end of the world as I can still run the server with no
problems, however it limits my ability to test which is a shame.
I have the
I am new to Django and trying to access binary file which is outside
project folder and open it in the browser.
When i try to do that it is saying Cross-Origin Request is blocked (Reason:
CORS header 'Access-Control-Allow-Origin missing).
Somebody, please help on this.
--
You received this me
Hi,
I am new to Django and working on some web project. I want to generate a
dynamic bar chart (using Chart Js library) by reading CSV file data.
Could you please somebody help on this...
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To uns
*Versions*
Django 1.10.5
Python 3.4.5
*settings.py:*
STATIC_URL = '/static/'
STATIC_ROOT = '/srv/myproject_static/'
STATICFILES_STORAGE =
'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
*Issue:*
When I run collectstatic some (not all) files will be post-processed even
though
Hi
Presumably you have had a look at logging docs and its not good enough?
https://docs.djangoproject.com/en/1.10/topics/logging/
With these sort of project requirements the way i have solved this in the
past is to:
*Work out who needs to receive certain messages. Draw a grid with all
useful messa
Well, answer is here:
https://docs.djangoproject.com/en/1.7/topics/testing/overview/#rollback-emulation
Need to use serialized_rollback = True in TransactionTestCase
Le mercredi 4 mars 2015 18:24:34 UTC+1, sam a écrit :
>
> Hello,
>
> I have an issue trying to run tests.
> My ap
Hello,
I have an issue trying to run tests.
My application use a migration to have default fixtures (created using
migrations.RunPython from a migration file).
The problem is when I launch manage.py test, the fixtures from the
migration are created on the "production" database and not on the t
I downloaded the latest code from stable/1.7.x branch and this problem no
longer exists.
On Monday, August 4, 2014 8:06:00 AM UTC-7, Sam Contapay wrote:
>
> Hi,
>
> I tried adding a foreign key to a model in a Django app I'm building to
> learn 1.7. I am using Python
Hi,
I tried adding a foreign key to a model in a Django app I'm building to
learn 1.7. I am using Python 3.4 and Django 1.7c2
#blog/models.py
from django.contrib.auth.models import User
from django.db import models
class Comment(models.Model):
user = models.ForeignKey(User, blank=True, nul
Can you provide some console output so we can see what commands you're
entering and what the actual output is?
On 17 July 2014 04:06, Malik Rumi wrote:
> Yesterday I tried to get the 1.7rc1 and got the error 'file contains no
> section headers'. I assumed this was because it was a tarball, and af
pi.python.org/pypi/GDAL/
> https://pypi.python.org/pypi/Shapely (Infers Geos)
>
> Thanks,
> Alex
>
> On 03/25/2014 05:34 PM, Sam Lai wrote:
>> I'm developing a site using Python 3.3, Django, Geodjango and
>> PostgreSQL. It is a bit tricky getting all the libraries to work, bu
Did you perhaps change the schema of the database after you had created it.
Eg: added null=True as a constraint after creating the table?
If so check the db sheme using:
python manage.py sqlall
It sounds simple enough. You will have to go into the db shell and update
your schema manually.
usin
I'm developing a site using Python 3.3, Django, Geodjango and
PostgreSQL. It is a bit tricky getting all the libraries to work, but
the stack does work. I installed GEOS using OSGeo4W, but I had to
explicitly specify the GEOS_LIBRARY_PATH and GDAL_LIBRARY_PATH in
settings.py.
On 25 March 2014 23:2
On 4 March 2014 14:36, Walter Wang wrote:
> I tried my best to follow the various guides out there, but the official
> documentation here
> https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/modwsgi/ has
> different instructions than the instructions here,
> https://www.digitalocean.com/
Did you try the steps listed in the geodjango documentation,
specifically
https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/#osgeo4w
and the following step to configure the environment? If you did and it
didn't work, what was the error?
On 16 February 2014 05:55, Nicholas Perez wrote
Oops, my memory failed me. They don't work with pip, but they do work
with easy_install, which virtualenvs have as well (at least mine do).
http://stackoverflow.com/a/5442340/150999
For example,
easy_install C:\Users\sam\Downloads\Pygments-1.6.win-amd64-py2.7.exe
On 29 January 2014
> However, even after downloading from that site they cannot be installed
> manually into a virtualenv! Only pip can do that.
You can install the packages from
http://www.lfd.uci.edu/~gohlke/pythonlibs/ by simply running -
pip install
... from inside your virtualenv. Those .exe files are pip-c
It looks like you have named one of your model classes with a name
that contains a non-ASCII character. Stick with class names with only
a-z, A-Z, 0-9 characters and see if that helps.
On 21 January 2014 10:29, Edgar Reyes wrote:
> Hi, I'm looking in google search about this error but I didn't fi
It's due to the accent on the e in your username. This is a 'bug' in the
way Python works with the Windows command prompt.
Long story short, just move the 'Python' directory out from your Desktop to
somewhere just on your C:\ drive (so your username isn't in the path) and
everything will work, e.g
w.com/questions/7335780/how-to-post-a-django-form-with-ajax-jquery
Hope this helps
cheers
sam
On Fri, Jan 10, 2014 at 2:44 PM, Frank Jaworski wrote:
> Hello,
>
> Essentially I am trying to take some pre-existing data for a user,
> populate a "list" with it, and then add/de
Can you try running 'python.exe manage.py runserver' outside of
PyCharm, i.e. in the Command Prompt/PowerShell?
I've got a similar setup, although on Windows 7, and it works. Instead
of setting environment variables, I added the following parameters
into my settings.py to indicate the location of
Ah, turns out all you have to do is specify -
fixtures = [ 'initial_data' ]
... in the TestCase and it'll load all the initial_data fixtures from
all apps. Still a bit odd that loading initial_data fixtures isn't the
default in tests though.
On 3 October 2013 16:49, S
the docs that mentions this either.
Thanks,
Sam
--
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 p
Yep. django-bootstrap-* and django-crispy-forms only provide helpers
for outputting HTML with bootstrap CSS classes. Neither are really
necessary to use Bootstrap (just makes it slightly easier), which is
applied through HTML and CSS and Django doesn't place any restrictions
on how your HTML/CSS i
The worst change i've had to make was a long time ago when we had to send
CSRF Token with Ajax calls because of a security exploit.
Had to write an entire regular expression and apply it to multiple template
files. Took perhaps 40 minutes.
However i can see some of the really old django snippets o
like "20 web designer tools" and you'll get
>> one of those blog posts that lists them all.
>>
>> And if you have time check out this list https://github.com/**
>> dypsilon/frontend-dev-**bookmarks<https://github.com/dypsilon/frontend-dev-bookmarks>.
Its not specific to django however i have a few small projects on the
horizon where i could really save time spent on the things im not good at:
Graphic design CSS layouts, choosing fonts, colours that look good.
What are the tools people are using for this these days? What are strong
points of t
Hi
In addition to what has already been said.
Make use of command line search tools. Hoe to search through all the python
files using BASH is a good example.
eg: In one of my projects i have to find all the places where a particular
class is called or instantiated: 'LocationAirfieldLookup'
find
Daniel is correct. One more point though, there are cases where you may
want to use the full url instead of just "/django_project/", in which case,
you should use settings.BASE_URL or {{ request.get_host }}.
To use either of those in the template, the template would need to be
rendered with a R
Hmm, yeah, Ryan could be onto something, but that doesn't really help
figure out the root cause (which likely was an error that existing before
upgrading but just went ignored).
What should help get to the root issue is checking out the postgresql log
file (for me: /var/log/postgresql/postgresq
If you are mainly using this for splitting stuff into multiple files, here
is what we do to accomplish the same thing but keep it so that templates
always inherit base.html instead of sidebar.html:
base.html:
{% extends 'header.html' %}
{% block main %}
{% endblock main %}
header.html:
{%
My guess is that unique=True was added after the table was created using
syncdb.
I'm guessing that most companies that use Django professionally use South (
http://south.aeracode.org/) to make schema changes easier.
Without South, you would have to keep the database in sync with the code
manual
I have 3 tables: Continent, Country and Story.
Country has ForeignKey(Continent) and Story has ManyToManyField(Country,
blank=True) field.
What I need is to get a list of countries which at least have one story
belonging to it, and I need these countries grouped by continents.
How can I achi
Hello,
What version of allauth are you trying to install and where did you get it
from?
https://github.com/pennersr/django-allauth/tree/0.10.0/allauth/socialaccount/migrations
is
the most recent version on pypi and has more than 2 migrations.
Could it be that you have another app installed th
Hi
In addition to the previous advice i would also check /etc/init.d/cron to
see if the daemon is running.
make sure you have the correct date+time settings in your shell eg: 'date'
command.
also run some sort of primitive debug command like:
* * * * * touch "/tmp/$(date +\%d-\%m-\%Y-\%T)"
for a
Oh and I just noticed you added "Also, some images could be blank/None"
Instead of 'if obj.id:' you can simply do 'if obj.id and obj.photo:'
On Monday, April 15, 2013 10:52:11 AM UTC-7, Sam Solomon wrote:
>
> One small correction, in 'list_display'
One small correction, in 'list_display' it should be 'admin_photo' (or I'd
probably put 'display_photo' (see #1 below)), not 'photo'.
Some other tricks:
1) If you don't want to clog up your Model class, you can put the function
in your ModelAdmin class.
2) If you add "readonly_fields = ('displa
t:
- Could someone be looking at a page that has a link while you are
deploying the code and then the link will take them to a 404?
- Is it in a search engine somewhere that will then be used by a user to
try to reach your site?
Sam
On Wednesday, April 10, 2013 11:41:28 PM UTC-7, Muli
Depending on if the expiration is a temporary thing or if you actually want
to permanently deactivate the user, this may be even simpler and database
efficient (and is what we use to ban users):
class DeactivateUserMiddleware(object):
def process_request(self, request):
if request.us
Not sure exactly what the issue is, but this may be handy (either as a
replacement or as an example of doing something somewhat similar):
https://github.com/disqus/django-bitfield
I believe on most machines the maximum is 63 "flags" though so you will
likely only be able to use it as an example
Here is something that may help:
import importlib
from django.conf import settings
for app in settings.INSTALLED_APPS:
views_name = "%s.views" % app
try:
importlib.import_module(views_name)
except ImportError:
pass
except:
print "Could not import %s" % vie
Tom Evans has probably the correct answer for you, but another thing that
I've done (maybe not 100% applicable in this case) is to have a default
base and then make it extendable from views when necessary:
{% extends base_template|default:"base.html" %}
This sounds like it isn't applicable in y
Not sure if this is what you meant by "we'll probably keep the javascript
reloading to process junks, waiting for the support of celery", but one
option without celery is to have the initial request save a bunch of
"PendingEmail" objects in the database and then redirect you to a
"send_queued_e
Hi
Helping people get started at work with PostgreSQL ad the most common
problem coming from MySQL users is they have trouble connecting to the
database:
setting up hg_hba.conf and some of the basic operations are different
to MySQL which confuses them.
I dont think there is an easiest way. Nginx+
1 - 100 of 510 matches
Mail list logo