ok thanx @ ludovic coues...
i will try this and then tell you
regards
On Thursday, August 18, 2016 at 2:38:46 AM UTC+5, ludovic coues wrote:
>
> Ok, sorry, I made a off by one error on the link :)
>
> Try that:
>
> # shops/admin.py
> from django.contrib import admin
> from products.models im
No idea. I've never looked into model managers.
Maybe they can help in non-repeating code, maybe they won't work due
to the lack of access to the currently logged user.
2016-08-18 12:55 GMT+02:00 M Hashmi :
> Ludovic,
>
> Shouldn't she be using model managers for this?
>
> Just curious.
>
> Regard
Ludovic,
Shouldn't she be using model managers for this?
Just curious.
Regards,
Mudassar
On Wed, Aug 17, 2016 at 2:37 PM, ludovic coues wrote:
> Ok, sorry, I made a off by one error on the link :)
>
> Try that:
>
> # shops/admin.py
> from django.contrib import admin
> from products.model
Ok, sorry, I made a off by one error on the link :)
Try that:
# shops/admin.py
from django.contrib import admin
from products.models import Product
from .models import Shop
class ShopAdmin(admin.ModelAdmin):
def formfield_for_manytomany(self, db_field, request, **kwargs):
if db_field
shops/admin.py
from .models import Shop
admin.site.register(Shop)
products/admin.py
from .models import Product, Variation, ProductImage, Category,
ProductFeatured, color_product, size_product
class ProductImageInline(admin.TabularInline):
model = ProductImage
extra = 0
max_num = 10
clas
On Wednesday, August 17, 2016 at 6:37:51 PM UTC+5, Shamaila Moazzam wrote:
>
> Hi,
>
> I am a beginner and please forgive me if my question is not up to the
> standard. I've got two models one is Product which is saved in db already
> and another one is Shop. I am trying to related both models
Could you share your admin.py file ?
You might be interested into this part of the documentation:
https://docs.djangoproject.com/en/1.10/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_for_foreignkey
2016-08-17 17:20 GMT+02:00 Shamaila Moazzam :
> @Ludovic there is no error. Just I d
@Ludovic there is no error. Just I don't want to get all the products
pre-populated. I need empty products field and only when user uploads
products then it should show me products. Please advise
On Wednesday, August 17, 2016 at 6:37:51 PM UTC+5, Shamaila Moazzam wrote:
>
> Hi,
>
> I am a beginn
@Mudassar this is exactly what I need.
On Wednesday, August 17, 2016 at 6:37:51 PM UTC+5, Shamaila Moazzam wrote:
>
> Hi,
>
> I am a beginner and please forgive me if my question is not up to the
> standard. I've got two models one is Product which is saved in db already
> and another one is
So what you are saying is that you don't need to get all the products
instead only products uploaded by a particular user?
This makes sense because you are getting the whole model called with the
key so if I am getting your question right you just need to apply some sort
of filter to get user relat
Do you have any error with the code you posted ?
It look like you already have a foreign key to your user.
2016-08-17 15:33 GMT+02:00 Shamaila Moazzam :
> Hi,
>
> I am a beginner and please forgive me if my question is not up to the
> standard. I've got two models one is Product which is saved in
Hi,
I am a beginner and please forgive me if my question is not up to the
standard. I've got two models one is Product which is saved in db already
and another one is Shop. I am trying to related both models with following
code.
class Product(models.Model):
user = models.ForeignKey(setting
gh The Django
> Book<http://www.djangobook.com/en/2.0/chapter14.html>and The
> Docs <https://docs.djangoproject.com/en/1.5/topics/auth/> , I think
> Django's built-in User Authentication system might be the tool I need. If
> so, I am a bit confused on the intended purpo
Docs <https://docs.djangoproject.com/en/1.5/topics/auth/> , I think
Django's built-in User Authentication system might be the tool I need. If
so, I am a bit confused on the intended purpose of the Auth System probably
because I am used to only using it with Django's built-in Ad
>
> But how can i "connect" this events with users from the Django Auth
> System?
> Is it a good idea to do this with a "ManyToMany" relation or not?
>
> Thanks.
>
> WoHinDu
>
>
--
You received this message because you are subscribed to the Go
pid question but i'm new at Django.
>
> I have a table called "Event" in this Table i store some events with
title,
> date/time an a description.
>
> But how can i "connect" this events with users from the Django Auth
System?
> Is it a good idea to
"connect" this events with users from the Django Auth System?
Is it a good idea to do this with a "ManyToMany" relation or not?
Thanks.
WoHinDu
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussio
CAS sounds very interesting as a SSO. I may give that a try, as well
as maybe just perform some unit tests just to make sure I know what is
going on under the hood. Thank you all for your much needed input.
Greg
On Feb 19, 10:32 am, Phlip wrote:
> geraldcor wrote:
> > and all will be good - I th
geraldcor wrote:
> and all will be good - I think. Does that sound reasonable?
Been there done that. But...
> using the given algorithm ('md5', 'sha1' or 'crypt').
^
Pick the right one wisely!
I would start with unit tests that attack
On Feb 19, 2:15 am, geraldcor wrote:
> All of your comments prompted me to start reverse engineering what
> django does and I came across the check_password method which just
> separates the algorithm, salt and hash and then sends it to the
> following method to compare the raw password to the h
All of your comments prompted me to start reverse engineering what
django does and I came across the check_password method which just
separates the algorithm, salt and hash and then sends it to the
following method to compare the raw password to the hash password. So
basically, in Ruby, I can do th
You could have a secure url that the RoR apps redirect to if the user
isn't authenticated with Rails. That url would have the login_required
decorator. If they successfully login on the django side (or are
already logged in), then they get redirected with some sort of get
variable user id + hash co
how about the RoR site serve authentications to the Django site over
Oauth?
unless if, as Tim's answer suggests, users don't want to log in twice?
and shouldn't the salt and hash pattern appear inside the auth contrib?
--
You received this message because you are subscribed to the Google Groups
Is it possible to transfer the valid session from Django to RoR? I'm not
really sure if that makes sense, but it's what comes to mind. Basically, if
you have already authenticated on one framework you should be able to pass
along the authentication without having to copy the password over.
FWIW
O
Hello all,
Internally, we have some RoR apps and Django apps. Our main website
runs on Django and is considered to be the main portal for all other
apps. Currently, we have a Rails authentication system and a Django
authentication system. We want to have one user table to authorize
against.
The o
6 nov 2008 kl. 05.40 skrev erdmaennchen:
>
> I'm doing some testruns on Django to find out how it fits me. Until
> now: Just great. But - as always - there are some problems you
> encounter when you are inexperienced with a specific framework. I've
> some Problems at the moment with the built-in
I'm doing some testruns on Django to find out how it fits me. Until
now: Just great. But - as always - there are some problems you
encounter when you are inexperienced with a specific framework. I've
some Problems at the moment with the built-in Django authentification.
I'm not sure if I'm just no
Why is anyone shocked that the print version of the book would have an
error?
--~--~-~--~~~---~--~~
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
T
a project?
Mat
-Original Message-
From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of James Bennett
Sent: 01 April 2008 21:47
To: django-users@googlegroups.com
Subject: Re: Auth System
On Tue, Apr 1, 2008 at 3:38 PM, Mat <[EMAIL PROTECTED]> wrote:
> I
On Tue, Apr 1, 2008 at 3:38 PM, Mat <[EMAIL PROTECTED]> wrote:
> I'm looking at django for a new project, and have a quick question, I'm
> going to need a mixture of the Query-set branch and generic-auth branch, I
> really need object based permissions, but it seems like generic-auth was
> las
news on a timeframe?
Should I try and merge query-set and generic-auth, or would I be better
waiting for any potential new auth system? Any thoughts, I'd love to hear
them,
Thanks in Advance,
Mat
--~--~-~--~~~---~--~~
You received this message because you are
On 10/18/07, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:
>
> On 10/18/07, Hugh Bien <[EMAIL PROTECTED]> wrote:
> > I was wondering if it was possible to customize Django's Auth system to not
> > include permissions, groups, or messages. For the app I'
On 10/18/07, Hugh Bien <[EMAIL PROTECTED]> wrote:
> I was wondering if it was possible to customize Django's Auth system to not
> include permissions, groups, or messages. For the app I'm working on, just
> have a User model would be great.
Just because they're
On Oct 18, 7:34 pm, "Hugh Bien" <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > I was wondering if it was possible to customize Django's Auth system to
> not
> > include permissions, groups, or messages. For the
if you only need User, write you own User model, no ?
On Oct 18, 7:34 pm, "Hugh Bien" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I was wondering if it was possible to customize Django's Auth system to not
> include permissions, groups, or messages. For the app I
Hi all,
I was wondering if it was possible to customize Django's Auth system to not
include permissions, groups, or messages. For the app I'm working on, just
have a User model would be great.
- Hugh
--~--~-~--~~~---~--~~
You received this message b
On Aug 6, 4:55 pm, LaundroMat <[EMAIL PROTECTED]> wrote:
> Are you sure you want to avoid that? I remember somebody here linking
> to an article where this wasn't advised, because it's (apparently)
> quite common for members of the same household to register with the
> same e-mail address (but wit
Are you sure you want to avoid that? I remember somebody here linking
to an article where this wasn't advised, because it's (apparently)
quite common for members of the same household to register with the
same e-mail address (but with another username ofcourse).
On Aug 6, 12:02 pm, Aljosa Mohorov
i'm checking username and email because i want to avoid situations
where some user registers with same email using different username.
Aljosa
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
Of the top of my head, but would the following be helpful?
user, new = User.objects.get_or_create(username = user, email =
email)
The function returns either:
- a new user object and True if the user didn't exist yet (and had to
be created);
- an object with existing user data and False.
Mind th
That's what I do (well, I just check the username, since I can't think
why you'd want to check the email). I don't think there's a better
way, it's pretty straightforward...
Poromenos
On Aug 6, 12:42 am, Aljosa Mohorovic <[EMAIL PROTECTED]>
wrote:
> i'm currently looking at django.contrib.auth a
i'm currently looking at django.contrib.auth and wondering what is the
correct way to check if user already exists?
before i call User.objects.create_user() i want to know that user with
submitted username and email doesn't exist.
my current situation is that i call
User.objects.get(username__exac
Filipe schrieb:
> works perfectly. Haven't detected any side effect yet.
> thanks.
Good to know! Perhaps you should file a ticket that
context_processors.auth should behave better when there's no
session. If you do, please include a link to this thread.
Michael
--~--~-~--~~-
Michael Radziej wrote:
> You need to copy the specific settings from
> django.conf.global_settings to your settings module, it is:
>
> TEMPLATE_CONTEXT_PROCESSORS = (
> 'django.core.context_processors.auth',
> 'django.core.context_processors.debug',
> 'django.core.context_processors
Michael Radziej wrote:
> Well, as a work around, if you don't use a database, you should
> remove
> "django.core.context_processors.auth",
> from TEMPLATE_CONTEXT_PROCESSORS in settings.py
hmm, I don't have that in settings.py. However, I do have:
INSTALLED_APPS = (
'django.contrib.auth
Filipe schrieb:
> Michael Radziej wrote:
>> Well, as a work around, if you don't use a database, you should
>> remove
>> "django.core.context_processors.auth",
>> from TEMPLATE_CONTEXT_PROCESSORS in settings.py
>
> hmm, I don't have that in settings.py. However, I do have:
Ah, it's there by
thanks
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For mor
Malcolm Tredinnick schrieb:
> OK, this is the problem line: RequestContext tries to access "user". The
> reason we are using RequestContext is because of ticket #688 (which is
> quite a reasonable change). However, we have to conditionally avoid this
> user requirement.
Well, as a work around, i
On Mon, 2006-09-25 at 10:28 +, Filipe wrote:
> I'm running django on linux, and using the latest trunk.
> When I got this particular traceback I was using mod_python, but the
> same happens using the built-in webserver (only, "ModPythonRequest" is
> replaced with "WSGIRequest" in that case).
>
I'm running django on linux, and using the latest trunk.
When I got this particular traceback I was using mod_python, but the
same happens using the built-in webserver (only, "ModPythonRequest" is
replaced with "WSGIRequest" in that case).
The full traceback follows:
___
On Mon, 2006-09-25 at 09:14 +, Filipe wrote:
> Raising an HTTP 404 while having DEBUG = False in settings.py makes a
> webpage show up with nothing but a traceback with the following error:
>
> [...]
> File
> "/usr/lib/python2.4/site-packages/django/core/context_processors.py",
> line 17, i
Request' object has no attribute 'user'
Is Django's authentication system needed in order to raise 404s? I had
a look to context_processors.py and got convinced that the 'user'
attribute mentioned has something to do with the auth system.
The website I'm deve
On 2/8/06, Jason Huggins <[EMAIL PROTECTED]> wrote:
>
> Luke Skibinski Holt wrote:
> > there is no per-record permission system
> > for users yet (or ever...). However this seems an unlikely scenario and
> > more often as not you will only want your users only looking/updating
> > data they have c
arely used all that flexibility, preferring roles based on
'student', 'staff', 'admin', 'supervisor' etc. That worked ok for us
(very ok).
All I'm after is some flexibility with the auth system - ie swap out
the django system and replace with a MySQL/Po
Hi Jason.
Your scenario only covers a very basic scenario, where 1 user can do
anything to a particular record.
It kind of falls down when you need to assign rights to actions.
ie..group/user X can add a new invoice, but only 'group/user Y' can
modify an existing invoice.
So while a constrained
Luke Skibinski Holt wrote:
> there is no per-record permission system
> for users yet (or ever...). However this seems an unlikely scenario and
> more often as not you will only want your users only looking/updating
> data they have created.
I had an "aha!" moment on this topic last night. My rep
Depends on your requirements and how much you can trust your users. If
you're talking thousands of users, each user will be stored as a record
in the database, and each of the databases supported by Django can
easily support millions of records (performance dependent on
hardware/design of course).
Not clear here on the authentication system. Is itdesigned for back-end
users or is it more generalized any authentication usage. Can it
handle thousands of users accounts?
Amit Upadhyay wrote:
...
> {% if form.has_errors %}
> Email or password incorrect
> {% endif %}
...
BTW I tried that, but ran into a small problem... hard-coding the error
message in the template like that masks the fact that "please enter a
correct username and password" isn't the only error th
On 1/26/06, Amit Upadhyay <[EMAIL PROTECTED]> wrote:
> On 1/27/06, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
>
>
> > 2. I want to have login form on each page. How should I process form,
> > if I want to stay inside built-in auth system? Dunno what should
On 1/27/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I`ve got couple of questions about auth system. Just a directions..1. How do I extend base User class? I`ve read about subclassing, but it
was two month ago and it was not very clear.. Is there any new method?I think you are talking
I`ve got couple of questions about auth system. Just a directions..
1. How do I extend base User class? I`ve read about subclassing, but it
was two month ago and it was not very clear.. Is there any new method?
2. I want to have login form on each page. How should I process form,
if I want to
62 matches
Mail list logo