Re: SyntaxError Creating New Project

2012-08-27 Thread Melvyn Sopacua
ject directory: /opt/python2.5/bin/python manage.py shell On the shell you get then: >>> from django.db import models >>> print models.__file__ I'm quite interested what that shows since your installation seems to be all over the place. -- Melvyn Sopacua -- You received t

Re: expand fieldset by choice

2012-08-27 Thread Melvyn Sopacua
a list, so it's easier to modify it. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-user

Re: My "Contributors" page Conundrum

2012-08-27 Thread Melvyn Sopacua
on. <https://docs.djangoproject.com/en/1.4/ref/models/instances/#django.db.models.Model.get_absolute_url> and make sure you read the permalink bit. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Problems with first tutorial

2012-08-28 Thread Melvyn Sopacua
On 28-8-2012 11:21, Snorre Edwin wrote: > It didnt seem to work. All i get is the error: > > C:\Prosjekter\Djangotest\testproject>python manage.py shell > ImportError: No module named user The traceback should show where the import error is raised: python manage.py shell --traceb

Re: Problems with first tutorial

2012-08-28 Thread Melvyn Sopacua
nse to you? It makes sense, since my guess is that you have Python 3.2 installed. Django 1.4 does not support python 3.x, only 2.5 through 2.7. Django 1.5 will be the first release supporting Python 3.x. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Gro

Re: expand fieldset by choice

2012-08-28 Thread Melvyn Sopacua
On 28-8-2012 14:30, Axel Rau wrote: > > Am 28.08.2012 um 00:13 schrieb Melvyn Sopacua: > >>> >>> Another question: How can I expand the right fieldset dependent of >>> current content of my choices field (as loaded from db) while >>> rendering th

Re: expand fieldset by choice

2012-08-28 Thread Melvyn Sopacua
ing with a copy of the list not the list itself - not sure about the 'not in form' issue, it may well be caused by the same issue as the bug report and needs a work around. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django user

Re: Combinable generic CBVs

2012-08-29 Thread Melvyn Sopacua
return super(OnSaleMixin, self).get_context_data( **context) class ProductList(ListView, OnSaleMixin) : model = Products -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Re: Combinable generic CBVs

2012-08-29 Thread Melvyn Sopacua
On 29-8-2012 18:46, Rainy wrote: > On Aug 29, 3:10 am, Melvyn Sopacua wrote: >> On 29-8-2012 4:44, Rainy wrote: >> >>> When I use CBVs, I nearly always end up needing to mix different types in >>> the same view, e.g. detail view and list view, list view and model

Re: admin save_model parameter 'change' is always true

2012-08-31 Thread Melvyn Sopacua
if a form field itself has changed or if there are any changes in the form. I haven't used these much, so you'll have to look around django/forms to or the docs to find them. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django user

Re: Using the CSRF token with two views

2012-09-01 Thread Melvyn Sopacua
content for the browser, so the contact form can have it's own CSRF token. Are you providing that token in the template that renders the contact form? -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: matching a name in url

2012-09-01 Thread Melvyn Sopacua
On 2-9-2012 0:48, Mando wrote: > here is my line of code > url(r'^comment/allcomments/(?P[-\w]+)/all/$', ^^^ > The current URL, comment/mando/all/, didn't match any of these. See it now? -- Melvyn Sopacua -- You received this

Re: Django development running on 127.0.0.1:8000 not accessible from same machine

2012-09-01 Thread Melvyn Sopacua
both IPv4 and 6). It makes no sense to do that. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send e

Re: What does this code do? Also, testing decorator via terminal?

2012-09-01 Thread Melvyn Sopacua
perform these operations and if the operation isn't supported then just let it blow up, but doing an isinstance check allows you to catch the error earlier and give a better diagnostic to the end user. There's also a negative to the check: If I have good reasons not to subclass HttpResponse bu

Re: Choosing a JS framework to go together with Django

2012-09-04 Thread Melvyn Sopacua
Op 4 sep. 2012 16:38 schreef "Peith Vergil" het volgende: > > i've been playing with KnockoutJS lately. +1 on knockout. > > -- > You received this message because you are subscribed to the Google Groups "Django users" group. > To post to this group, send email to django-users@googlegroups.com. >

Re: error in the "Writing your first Django app, part 2"

2012-09-06 Thread Melvyn Sopacua
You're using development version of Django. Python 2.5 support is dropped there. Use official 1.4 release. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from th

Re: how to use timezones for datetime fields that are foreign keys in admin interface

2012-09-08 Thread Melvyn Sopacua
ses the unicode representation by default. See here: <https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display> -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: Changing the text on the admin "change_list.html"

2012-09-11 Thread Melvyn Sopacua
That would be the verbose name in the models' meta class. I think Op 8 sep. 2012 18:34 schreef "Derek" het volgende: > I need to alter the text that appears above every change list in my app: > > "Select *modelname* to change" > > However, I cannot see this text in the change_list.html file - > w

Re: models for KML file

2012-09-11 Thread Melvyn Sopacua
Op 11 sep. 2012 11:07 schreef "Coulson Thabo Kgathi" het volgende: > > Somebody help with using kml files to plot points on maps using geodjango > Please read and understand the Geodjango tutorial and Gdal layermapping API. If you need help understanding that, ask specific questions about parts t

Re: Plot points from a kml file in django

2012-09-12 Thread Melvyn Sopacua
Open your models in the admin. Fwiw, Geodjango uses overlays on externally hosted basemaps using openlayers API. Rendering maps natively is not supported, as far as I can tell. One a would use mapserver for that. -- You received this message because you are subscribed to the Google Groups "Djang

Re: Alternatives to CBVs (class based views)

2012-09-12 Thread Melvyn Sopacua
Op 12 sep. 2012 18:58 schreef "Cal Leeming [Simplicity Media Ltd]" < cal.leem...@simplicitymedialtd.co.uk> het volgende: > > Hi all, > > There is a lot of debate on whether there is a real future for the Django CBVs (class based views). ..snip.. > > Any thoughts? > I understand what you're getting

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Melvyn Sopacua
delAdmin.get_readonly_fields() is for. If this doesn't work for you, can you explain why? -- Melvyn Sopacua -- 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 e

Re: how do I handle a dropdown in Django whose only purpose is to get data.

2018-01-26 Thread Melvyn Sopacua
ying a 3rd party app, written by someone with a decent amount of Django experience. Finally, when accessing form data from a valid form, we access form.cleaned_data and generally use a local variable to reference the dict: if form.is_valid(): data = form.cleaned_data # do stuff with data -- Me

Re: how do I handle a dropdown in Django whose only purpose is to get data.

2018-01-30 Thread Melvyn Sopacua
ntro to Python, I highly suggest Python Tips[1]. project layout[2] and in your case, getting a handle on views[3] and querysets[4]. > > On Friday, January 26, 2018 at 3:12:19 PM UTC-5, Melvyn Sopacua wrote: > > There are a bunch of issues with this code: > > > > 1) Spell

Re: Form field label template

2018-02-10 Thread Melvyn Sopacua
ould use the new template-based widget rendering, but to my surprise those > templates don't include the labels. Is there a way to achieve this without > rendering every field manually? Save yourself some trouble: http://docs.viewflow.io/material_forms.html -- Melvyn Sopacua -- Yo

Re: Admin Master-Detail: Dynamically filter selections in detail

2018-02-11 Thread Melvyn Sopacua
hould be doable via js and ajax but I've no idea how > this should be done. Any ideas, pointers or hints? All ajax/js done for you in DAL[1]. -- Melvyn Sopacua [1] https://django-autocomplete-light.readthedocs.io/en/master/tutorial.html#filtering-results-based-on-the-value-of-o

Re: Basic note/trello app - how to link model object IDs

2018-02-14 Thread Melvyn Sopacua
rs is *very* > > straightforward. > > When in doubt, revisit the Django tutorial. This part is a good one for > > where you're at: https://docs.djangoproject.com/en/2.0/intro/tutorial03/ You did not follow this advice, or you would already know how to tie the url to the prim

Re: edit model properties in the admin

2018-02-14 Thread Melvyn Sopacua
nting this from working and without code and corresponding backtrace we cannot diagnose what. -- Melvyn Sopacua -- 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

Re: Making an object unsaveable ...

2018-03-06 Thread Melvyn Sopacua
Present a detail view of the object. Since this is for display purposes, why does it have to remain a model? -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fr

Re: Attribute error at /admin/ by Django

2018-04-06 Thread Melvyn Sopacua
On vrijdag 6 april 2018 09:05:20 CEST Hamroz Jumaev wrote: > http://dpaste.com/2GDFCG8 No middleware. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fro

Re: new Feature: yay or neigh?

2018-04-07 Thread Melvyn Sopacua
s not two-way communication. This should be handled in javascript and Django cannot do anything for you here as it's not part of the problem. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: username and allowed alphanumeric, why?

2018-04-11 Thread Melvyn Sopacua
Yeah. It's explained a few lines below in the box titled "Usernames and unicode". The special chars mentioned are just as random I presume. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscri

Re: Error with channels and celery

2018-04-19 Thread Melvyn Sopacua
ion to [::1] (IPv6) or localhost (and your OS set to prefer IPv6). > app.conf.update( > BROKER_URL = 'redis://127.0.0.1:6379/0',) But not there, apparently. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users"

Re: username and allowed alphanumeric, why?

2018-04-19 Thread Melvyn Sopacua
ept non-printables and control characters ("the usual"). Adding a = poses no danger. -- Melvyn Sopacua -- 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 i

Re: Updating reCaptcha (widget) in django-based OSQA

2018-04-21 Thread Melvyn Sopacua
On vrijdag 20 april 2018 16:17:05 CEST DougN wrote: > Thanks for any pointers. Same. Could you include the URL to the repository of the captcha implementation you're using? I've looked at 2 now and neither of them have the code you posted. -- Melvyn Sopacua -- You received

Re: ImageSlider in Django

2018-04-21 Thread Melvyn Sopacua
On vrijdag 20 april 2018 14:30:07 CEST deviya sweety wrote: > I've tried to use Django-hero-slider in my project but when I try to add > slideritem objects in the admin page I'm getting error. Did you read the error? -- Melvyn Sopacua -- You received this message because yo

Re: Case inconsistency

2018-05-09 Thread Melvyn Sopacua
es requests: https://tools.ietf.org/html/rfc2616#page-36 -- Melvyn Sopacua -- 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...@goog

Re: Case inconsistency

2018-05-10 Thread Melvyn Sopacua
the case of the form's method attribute from `get` to `GET` would change anything. > > -Original Message- > From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] > On Behalf Of Melvyn Sopacua Sent: Wednesday, May 9, 2018 6:21 PM > To: django-use

Re: Unit testing models.py

2018-05-14 Thread Melvyn Sopacua
you wouldn't test: anything dealing with _meta. Test these further downstream, by verifying form labels and their translated version if it applies. And I'd say the exact wording of a form label may not be at all important, so you could skip this. -- Melvyn Sopacua -- You received this m

Re: SQL select statements to Django ORM

2018-05-14 Thread Melvyn Sopacua
print('name', 'date of birth', 'age') for person in people: print(people.name, people.dob, people.age) -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from th

Re: SQL select statements to Django ORM

2018-05-14 Thread Melvyn Sopacua
nveigh here, is not to shoehorn the ORM into your notion of SQL, but to think in models, model fields, object properties and model relations. There will be times where the ORM needs help from SQL, but pick your battles. -- Melvyn Sopacua -- You received this message because you are subscribed

Re: SQL select statements to Django ORM

2018-05-14 Thread Melvyn Sopacua
d do in the database, but you'd still not use annotate, cause you can simply filter on the dob using standard __gte/__lte etc. lookups. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from thi

Re: Adding to all templates context via Middleware

2018-05-14 Thread Melvyn Sopacua
that if my settings isn't deemed authoritative and Django just fills in what it thinks it's missing 2) If you want to "edit defaults in project settings" you are bound to run into circular imports as the Django settings needs to load your settings and you want to import the D

Re: getting error while reloading the url"http://localhost:8000/polls/".The error is given below.Please tell my why i am seeing this error?

2018-05-19 Thread Melvyn Sopacua
traces are hard to read or do not have the answer in an obvious way. But so far, you haven't encountered those at all. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Public Django administrative database

2018-05-19 Thread Melvyn Sopacua
provided in a useful format. Therefore it sometimes pays off to go with alternative proprietary services, purchase databases that have information linked properly or go with Open Street Map. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django us

Re: Standard approach

2018-05-19 Thread Melvyn Sopacua
7;s charter: http://www.catb.org/esr/faqs/smart-questions.html -- Melvyn Sopacua -- 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...@

Re: New to Python

2018-05-19 Thread Melvyn Sopacua
page to view or use using python as well. Since you're in the Django user group, you would use Django and it's template engine: https://docs.djangoproject.com/en/2.0/topics/templates/ -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups &

Re: Django login() function works in production but not in development

2018-05-19 Thread Melvyn Sopacua
doesn't get logged in? -- Melvyn Sopacua -- 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 post to t

Re: django 2.0 tutorial :: exception:: application labels are not unique.

2018-05-21 Thread Melvyn Sopacua
this setting. It's you. Cause you filled in "polls" as the application name (not the project name). -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving ema

Re: Issue with Django migrate - fine with 2.7x python, but error with 3.6.4?

2018-05-23 Thread Melvyn Sopacua
can be different from the py2 version. >From the backtrace it isn't clear though which app is causing this. If it really is a py2 versus py3 issue, then I suspect that some migrations are done only for py3, though that is really bad practice. -- Melvyn Sopacua -- You received this mess

Re: Starting your first app

2018-05-23 Thread Melvyn Sopacua
obsolete with Django 1.8 (and we're now on 1.11LTS / 2.0 and 2.1 is around the corner). https://docs.djangoproject.com/en/2.0/#first-steps -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from t

Re: Issue with Django migrate - fine with 2.7x python, but error with 3.6.4?

2018-05-24 Thread Melvyn Sopacua
a protocol for your developers to communicate with eachother when adding and removing migrations. -- Melvyn Sopacua -- 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,

Re: help me out

2018-05-24 Thread Melvyn Sopacua
On donderdag 24 mei 2018 17:28:53 CEST Umar Kambala wrote: > It is located in mysite/polls/template/polls/ It should be in mysite/polls/templates/polls/ Note: templates with an s, not template. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Gro

Re: Multisite strategy

2018-05-24 Thread Melvyn Sopacua
he right place. > > > > Is `contrib.site` suitable for that scenario? > > I was thinking at 3 different sites. > > If so, how can I use them locally while in development? > > > > Any other suggestions? > > > > Best, > > Carlo -- Melvyn S

Re: money field question

2018-05-29 Thread Melvyn Sopacua
7;{:.48f}'.format(23.45)) >>> print('{:.55f}'.format(23.45)) So decimal.Decimal's constructor converts strings to decimal numbers with as much precision as given. It also applies to floats, except that floats have more precision then typed. -- Melvyn Sopacua -- You r

Re: ValueError at /polls/1/vote/

2018-05-29 Thread Melvyn Sopacua
On dinsdag 29 mei 2018 14:07:59 CEST Caleb Bryson wrote: > def vote(request, question_id): > ... # same as above, no changes needed. You fell into the cut-and-paste-without-reading trap. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups &

Re: href not working

2018-05-31 Thread Melvyn Sopacua
in both views. -- Melvyn Sopacua -- 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 post to this group, se

Re: href not working

2018-05-31 Thread Melvyn Sopacua
#x27;^admin/', admin.site.urls), > > url(r'^', include( 'hybridair.urls')), This matches anything that has a beginning. So that always matches, anything after it, is ignored (Django works on first match base). > url(r'^', views.index, name=&#x

Re: dumpdata fails with crytpic error

2018-06-01 Thread Melvyn Sopacua
On vrijdag 1 juni 2018 06:22:43 CEST Bernd Wechner wrote: > Anyone seen this before. How does one diagnose this given the vague nature > of the message? Using the --traceback flag. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "D

Re: URL Concatenation Issue

2018-06-01 Thread Melvyn Sopacua
r own. You are missing a few fundamentals the tutorial touches upon, such as the basics of URLs and URL paths[2]. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0/intro/tutorial03/#removing-hardcoded-urls-in-templates [2] https://stackoverflow.com/a/904066/1600649 -- You r

Re: Call to method that takes in a request

2018-06-01 Thread Melvyn Sopacua
o test a view, use the TestClient[1]. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0/topics/testing/tools/#the-test-client -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop re

Re: Implementing a 'please wait' page

2018-06-01 Thread Melvyn Sopacua
way to do this and this tutorial shows all things required to provide user feedback: https://buildwithdjango.com/blog/post/celery-progress-bars/ -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: Updating django database

2018-06-02 Thread Melvyn Sopacua
anager operation. The first cannot. -- Melvyn Sopacua -- 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 po

Re: Sponsor subdomain pointing to part of our Django site?

2018-06-03 Thread Melvyn Sopacua
what breaks. I don't think anything breaks at all. -- Melvyn Sopacua -- 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...@googlegrou

Re: Generating server-side off-line HTML of Django pages ...

2018-06-04 Thread Melvyn Sopacua
related information (like logged in user). The cheaper method is something like this code[2], but this only renders the template and you'd have to provide a context so view code is bypassed. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0/topics/testing/tools/#the-tes

Re: Sponsor subdomain pointing to part of our Django site?

2018-06-04 Thread Melvyn Sopacua
quot;how can i be sure there are no mistakes in our code", then you should already know the answer - test, test, test :). -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/2.0/ref/contrib/sites/#getting-the-current-domain-for-display -- You received this message because you are

Re: python manage.py (anything) NOT WORKING ANYMORE

2018-06-04 Thread Melvyn Sopacua
error with anything I enter after > the ./manage.py (i.e. runserver, dbshell, etc) You most likely switched to Python 3. But a backtrace would help a lot to understand the cause. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users&

Re: Sponsor subdomain pointing to part of our Django site?

2018-06-04 Thread Melvyn Sopacua
On maandag 4 juni 2018 20:40:03 CEST Richard Brockie wrote: > On Mon, Jun 4, 2018 at 9:01 PM Melvyn Sopacua wrote: > > This isn't a problem. Neither url nor reverse is capable of returning URLs > > with hostnames, at least not that I'm aware of. Only djang

Re: Do you modify third party code used in your projects?

2016-11-03 Thread Melvyn Sopacua
tory. When I need to summarize it, I'd say this is my approach: 1. Verify if I'm fixing the problem in the right object / application layer. 2. Check author(s) responsiveness to tickets 3. Decide whether to keep this app or look for a different one 4. Submit problem with real world cas

Re: How to GROUP BY in django?

2016-11-03 Thread Melvyn Sopacua
On Thursday 03 November 2016 03:15:31 Awadhesh Meshram wrote: > How to GROUP BY using any identical field in database in Django? https://www.google.com/search?q=django+group+by Grouping is called "aggregation" in DBA lingo. -- Melvyn Sopacua -- You received this message be

Re: django 1.10 error (SSL error: called a function you should not call)

2016-11-03 Thread Melvyn Sopacua
all SSL protocols all together and only support TLS 1.1 and 1.2 since the others are insecure: <https://github.com/ssllabs/research/wiki/SSL-and-TLS-Deployment-Best-Practices#22-use-secure-protocols> -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Group

Re: Storing settings

2016-11-07 Thread Melvyn Sopacua
user_profile.quadrant1 == option.id %} Can you show the part in the view where you provide this variable to the template? If you don't, then that's your problem and the fix that probably works is to use request.user.profile.quadrant1. -- Melvyn Sopacua -- You received t

Re: Need help to catch "cart_id" based on session.

2016-11-07 Thread Melvyn Sopacua
ss a cart id SHALL be present in the session and as such we need to error out hard and not suppress. This is a configuration issue by OP or a bug in the software, but I'm not familiar enough with doorsale to say which. At first glance though, the view handling it and the views preceeding t

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2016-11-09 Thread Melvyn Sopacua
e/password. Another is having different authentication servers and what server to use is depending on a field that isn't in the user model, like "faculty" or "signup_date.year". Hope this helps, -- Melvyn Sopacua -- You received this message because you are subscribed to t

Re: Admin - saveasnew to another database

2016-11-09 Thread Melvyn Sopacua
to use serialization with natural keys and a job scheduler. Cron will do, but there's plenty other schemes allowing you to provide feedback about the job queue and expected time of completion. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups &qu

Re: strategies for adding a custom group permission

2016-11-09 Thread Melvyn Sopacua
ttps://docs.djangoproject.com/en/1.10/topics/auth/default/#django.contrib.auth.decorators.user_passes_test> -- Melvyn Sopacua -- 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 i

Re: Unique app name error problem when building a Wagtail multisite solution

2016-12-22 Thread Melvyn Sopacua
example Mezzanine) that is. Especially one that uses the multi-tenancy that is built-in to django through the sites module. Don't work against the flow :) -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To un

Re: Postgres SQL vs SQLite vs MS SQL vs MY SQL

2016-12-22 Thread Melvyn Sopacua
s simple: What can MSSQL do, that you actually *use* that others cannot. When you put the emphasis on feature use, a lot of propriety software becomes schockingly expensive and cheap to work around / do differently in perspective. -- Melvyn Sopacua -- You received this message because you a

Re: How to display user's photo that i follow in post's list in Django

2016-12-22 Thread Melvyn Sopacua
ay their photo. * in Profile.get_photo() you set users to self.photo. I don't think you wanted to do that. -- Melvyn Sopacua -- 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, sen

Re: bug of session middleware --- session never expires

2016-12-25 Thread Melvyn Sopacua
is the reason you want this? It's almost never a good a thing. Only good case I can think of is in game or test settings, where you need to complete certain tasks within a set timeframe. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/1.10/topics/http/sessions/#browser-len

Re: How do I translate site.name to other languages?

2016-12-25 Thread Melvyn Sopacua
but since Site is a Django Model, have a look at Django Model Translation[1]. I suspect once you get the idea, you'll use it throughout the project. -- Melvyn Sopacua [1] http://django-modeltranslation.readthedocs.io/en/stable/registration.html -- You received this message b

Re: How to display user's photo that i follow in post's list in Django

2016-12-25 Thread Melvyn Sopacua
if *self.following.get*(*user*=*user*)*.count*() > *0*:return *user.profile.photo.url*return Noneexcept *user.ObjectDoesNotExist*:return Noneelse:return *user.profile.photo -- Melvyn Sopacua -- You received this message b

Re: bug of session middleware --- session never expires

2016-12-28 Thread Melvyn Sopacua
7;t know about it anymore. So the old session *could* be taken over by someone listening on the wire. This is why encryption is paramount and browser now support Strict Transport Security[1]. -- Melvyn Sopacua [1] https://github.com/ssllabs/research/wiki/SSL-and-TLS-Deployment-Bes

Re: Subclassing Models in non model class

2016-12-28 Thread Melvyn Sopacua
class parameters. > > Idea is to create a model and use that model with non db reference in > admin.py. Following is the code: It's quite unclear what you want and why you want it especially. What does this other Address model represent? -- Melvyn Sopacua -- You received this messag

Re: Djnago project to installer

2016-12-28 Thread Melvyn Sopacua
ground. The Django part is easy, even having a pre-set settings.py can be done and a pre-filled SQLite database can be shipped as well. The hard part is to fire it up and shutdown when you need it to. Is this for presentation of a new website or for an stand-alone application? -- Melvyn Sopacua --

Re: Advise for first project in Django

2016-12-30 Thread Melvyn Sopacua
I'd like to know if it's feasible or not ? Do you mean that users can login, upload their music and listen to it anywhere? Here's some starters: * HTML 5 multimedia[1] * Streaming Server[2] * Django Accounts[3] / Mezzanine Accounts[4] -- Melvyn S

Re: Method Flowchart for Generic Editing Views

2017-01-10 Thread Melvyn Sopacua
wever, for the generic editing views this seems to be missing. ... > Is there a place where I can see the method flowchart for the generic > editing views? I believe you missed the link in the documentation: https://ccbv.co.uk/ It's probably more than one can do in the documentation. --

Re: Question Is Django Rest Framework only for APIs or can i Use it to create Users for a website?

2017-01-10 Thread Melvyn Sopacua
* to *your application*. Django Rest Framework exposes your *internal API* to *other applications*. -- Melvyn Sopacua -- 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 e

Re: Problem in django tutorial 5 , 1044 Access denied for user @'localhost' database error

2017-01-12 Thread Melvyn Sopacua
tabase 'test_myproject'") > I also ran ,"GRANT ALL PRIVILEGES ON test_myproject TO > 'myprojectuser'@'localhost';" , in mysql This isn't the same as: GRANT ALL PRIVILEGES ON test_myproject.* TO ...; which is what you need. Yes, I'm ma

Re: Get current site inside model

2017-01-14 Thread Melvyn Sopacua
self._meta.object_name.lower*())return *reverse*(*viewname*) /@/classmethoddef set_site_for_model(*cls, site_id_or_obj*):if /isinstance/(*site_id_or_obj, Site*):*cls._site_id *= *site_id_or_obj.pk*else: *cls._site_id *= *site_id_or_obj */

Re: models foreign key

2017-01-14 Thread Melvyn Sopacua
How did you determine there's no connection? What database are using? If using MySQL do you have InnoDB storage engine enabled? -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group an

Re: Decrease amount of identical "Email reports"

2017-01-14 Thread Melvyn Sopacua
o this kind of thing. It's best to look there and not in the web framework. Chances are your admins already have some sort of monitoring in place, so look for something that ties in (can be tied in) with that. -- Melvyn Sopacua -- You received this message because you are subscribed t

Re: Issue whe migrate with relation between tables in different schemas

2017-01-14 Thread Melvyn Sopacua
mented at the project level, not on a table level and for a specific purpose. And finally, there's this approach[3], where you'd have to write the routing yourself - trivial to do and when done correctly should be easy to refactor to any solution Django comes up with in fu

Re: Override base filter for model's queryset (Django 1.6)?

2017-01-14 Thread Melvyn Sopacua
On Saturday 14 January 2017 21:20:32 Derek wrote: > and I also want to override the base filter for > the model's > queryset to limit what is displayed. This is covered in the Manager documentation[1] in detail. -- Melvyn Sopacua [1] https://docs.djangoproject.com/en/

Re: Override base filter for model's queryset (Django 1.6)?

2017-01-15 Thread Melvyn Sopacua
is doesn't set the default filter to 'general', but it does make filtering transparent (and allows access to objects which are not 'general'). P.S.: The reason I pointed to 1.10 docs is simple: 1.6 is no longer supported by the Django Project and it's documentation ha

Re: models foreign key

2017-01-15 Thread Melvyn Sopacua
" is not the problem. Use: python manage.py sqlmigrate to show the SQL created for that migration. If you see no foreign key being created in the SQL, then follow-up with the code of the migration file and the SQL shown by above command. > On Sun, Jan 15, 2017 at 12:16 AM, Mel

Re: How to make a queryset into a database, starting from a template html

2017-01-18 Thread Melvyn Sopacua
There's a reusable app that has solved this and I know is stable: https://github.com/digi604/django-smart-selects There's also: https://github.com/lehins/django-smartfields but seems to become abanonware and I've never used it so can't comment on how well it works. -- M

Re: prepopulate form with model instance values using UpdateView and ModelForm

2017-01-18 Thread Melvyn Sopacua
t with field values from the instance. Any missing values get assigned defaults. * Delete view: gets an instance ID and removes it. Field values typically do not come into play. Does this conflict with what you're trying to accomplish? -- Melvyn Sopacua -- You received this messa

Re: prepopulate form with model instance values using UpdateView and ModelForm

2017-01-18 Thread Melvyn Sopacua
hat uniquely identifies the object and then override get_object() to work with that. Note that little added security is gained from hiding the PK, but if user-friendly URLs is what you're after, slugs (or some other field(s) with unique=True) are the way to go. -- Melvyn Sop

Re: ModelForm "error_css_class" not getting applied to ValidationErrors raised in model.clean()

2019-07-16 Thread Melvyn Sopacua
, use the same form for admin, but your core problem is that you mix input validation (task of form) with data consistency (task of model). Keep those separated as much as possible and things will go smoother. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google

<    1   2   3   4   5   6   7   >