Hello all,
I'm working on a class assignment, so I'm not seeking a specific
answer/code, but I'm just trying to figure out a general process.
The task is this...
I have some markdown files located in a directory, however when running the
website they need to be displayed as html. Because this
routers.py),
which, among others, does:
regex = route.url.format(
prefix=prefix,
lookup=lookup,
trailing_slash=self.trailing_slash
)
where `route.url` is something like
url=r'^{prefix}/{lookup}{trailing_slash}$',
and `prefix` is the first argument you pass to `router
ible to write the code below without using regex?
>> Thanks
>>
>> from .views import TaskViewSet
>> from rest_framework.routers import DefaultRouter
>>
>> router = DefaultRouter()
>> router.register(r'', TaskViewSet, basename='task')
>&
kevin@kjay,net
On Wed, May 22, 2019 at 10:19 AM Rounak Jain wrote:
>
> I am using DRF Viewsets to auto-generate URLs for different views. Is it
> possible to write the code below without using regex?
> Thanks
>
> from .views import TaskViewSet
> from rest_framework.routers
Thanks for the reply. I understand how to use them in urls.py when creating
normal routes but here in case of drf, it would help if you could show me
how to do it
On Wed, May 22, 2019 at 10:11 PM Onasanya Tunde
wrote:
> Use Django2.X
>
> --
> You received this message because you are subscribed
Use Django2.X
--
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, send email to django-users@google
I am using DRF Viewsets to auto-generate URLs for different views. Is it
possible to write the code below without using regex?
Thanks
from .views import TaskViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'', TaskViewSet, base
Thank you so much for your help, Melvyn.
With your help I managed to the the code running :)
Here it is, if somebody should find it helpful.
cheers, Mikkel
>From somewhere, e.g. models.py
# The list of model names (just add your model names to it)
def GetItemNames():
return [ 'Year', 'Vintage
On zaterdag 23 juni 2018 14:30:08 CEST Mikkel Kromann wrote:
> In models.py:
> def GetItemPaths():paths = [ ]
> for i in [ 'Model1', 'Model2', 'Model3' ]:
> p = path( i + '/list/', ItemListView.as_view(model=i), name=i +
> '_list' )
> paths.append(p)
>
> return paths
>
So, I think I have a neat idea for solving my problem, simply make a
function which returns a list of path() returns.
In urls.py
urlpatterns = GetItemPaths() + [
# other paths
]
In models.py:
def GetItemPaths():paths = [ ]
for i in [ 'Model1', 'Model2', 'Model3' ]:
p = path( i +
On donderdag 21 juni 2018 10:19:08 CEST Mikkel Kromann wrote:
> However, I'd really like to give all my urls names so that they can be
> easily reversed (e.g. success links).
> urlpatterns = [
> path('list//',ItemListView.as_view(), name=
> mName+'_list'),
> ]
>
> From what I
I have a lot of models (say 30 or 40) which are so similar, that I have
handled them using slightly modified class based views.
In urls.py:
urlpatterns = [
path('list//',ItemListView.as_view()),
path('create//', ItemCreateView.as_view()),
path('update//', Ite
On Monday, 12 September 2016 14:36:23 UTC+1, ashish...@finoit.co.in wrote:
>
> I've configured user's username field in following way
>
> username = models.CharField(
> _('username'),
> max_length=30,
> unique=True,
> help_text=_('Required. 30 characters or fewer. Le
I've configured user's username field in following way
username = models.CharField(
_('username'),
max_length=30,
unique=True,
help_text=_('Required. 30 characters or fewer. Letters, digits and
@/./+/-/_ only.'),
validators=[
validators.RegexVal
which regex are for filtering malicious input in django?
--
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.
I got it! :D (?P\w+) and NOT (P? .
Am Mittwoch, 11. März 2015 21:57:34 UTC+1 schrieb inoyon artlover
KLANGRAUSCH:
>
> I don't understand why this doesn't work and smashes an
>
> '*The current URL, lighter, didn't match any of these.'*
>
> my models.py
>
> class ShopList(models.Model):
>
I don't understand why this doesn't work and smashes an
'*The current URL, lighter, didn't match any of these.'*
my models.py
class ShopList(models.Model):
name = models.CharField(max_length=100, null=True, blank=True)
description = models.CharField(max_length=100, null=True, blank=True
pull out all the records and do the
count/filter with Python code.
On Sun, Jan 25, 2015 at 10:58 PM, wrote:
> I posted this question to stackover flow but didn't get a good answer:
> http://stackoverflow.com/questions/28080545/django-find-duplicates-with-queryset-and-regex
>
>
I posted this question to stackover flow but didn't get a good answer:
http://stackoverflow.com/questions/28080545/django-find-duplicates-with-queryset-and-regex
I want to find duplicates in db fields with a regex.
I know I can use this to find duplicates:
self.values('Website')
scrub this may bad found I was re-writing the error message to "" later on
d'oh
--
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...@google
date_from)
#raise NameError(goodmatch)
if goodmatch:
pass
else:
date_from_error = "Incorrect input, must be dd/mm/yyy format"
goodmatch seems to always be None.
I tested the regex at regex101 abd it works with test data like 27/10/2015
date_from
try this one
url(r'/(?P\d+)$', DetailView.as_view(
model = Customer,
template_name="customer.html")),
Many thanks,
Serge
+380 636150445
skype: skhohlov
--
You received this message because you are subscribed to the Google Groups
"Django users
ive also tried
url(r'^customers/([0-9])/$', DetailView.as_view(
model = Customer,
template_name="customer.html")),
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group
Im using detailview to display customer individualy when the link is
clicked on but its not recognizing the number i think my regex is wrong..
this is what i have
from django.conf.urls import patterns, include, url
from django.views.generic.list import ListView
from
On Friday, March 14, 2014 8:14:57 PM UTC-4:30, David wrote:
>
> I am wodering whether my implementation is incorrect or whether there is
> a typo in the textbook. My question is how I can make sense of these
> instructions: "The regular expression to match about/ is r'^about/'".
>
> I was follow
You're meant to only have one include that redirects URLs beginning with
rango to the app's urls.py.
Then, the app's urls.py must not have /rango in the URLs. The idea is that
all URLs starting with "rango" get the "rango" stripped off and passed to
the rango app, which itself has / and /about.
-
Dear list,
I am wodering whether my implementation is incorrect or whether there is
a typo in the textbook. My question is how I can make sense of these
instructions: "The regular expression to match about/ is r'^about/'".
I was following the "Tango with Django" book.
In the exercises of chapter
rk in my situation. I don't know why.
>>
>> When I try to use the "url" tag in any template an exception is raised:
>> "'str' object has no attribute 'regex'"
>>
>> for example, with this I got the error:
>>
:
>
> Hello list
>
> I know, this question has been posted and resolved before, but the
> solutions don't work in my situation. I don't know why.
>
> When I try to use the "url" tag in any template an exception is raised:
> "
'.' matches any character except a new line
Sent from my Windows Phone
--
From: arm
Sent: 1/25/2013 10:09 AM
To: django-users@googlegroups.com
Subject: regex
Hi,
I'm trying to figure out the regular expressions that will match any number
and punctu
On Fri, Jan 25, 2013 at 2:09 AM, arm wrote:
>
> Hi,
>
> I'm trying to figure out the regular expressions that will match any
> number and punctuation and chars like +,#,§ etc . Any advice?
http://www.regular-expressions.info/charclass.html
--
You received this message because you are subscribe
Hi,
I'm trying to figure out the regular expressions that will match any number
and punctuation and chars like +,#,§ etc . Any advice?
--
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@googleg
You can explicitly add the Turkish characters to the character class if
there are just a few of them. You could also use the UNICODE regex flag and
do something like ur'(?u)^[^\W\d_]+$', which will match any string
consisting solely of alphabetic unicode characters.
2013/1/16 arma
you can use unicode.
2013/1/16 armagan
> Turkish chars
--
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-users+unsubscr...
Hi,
I'm trying to use regex patterns in django form. I successed in only
letters regex pattern. But form controler declines Turkish chars. I think I
must use utf-8 regex. Can you help me?
name = forms.RegexField(regex =r'^[a-zA-Z]+$')
Thanks for help.
--
You received this
Fantastic solution, thank you so much. I will be sure to loose those
phrases from my vocab as well :)
On Monday, August 27, 2012 3:18:52 AM UTC-4, Melvyn Sopacua wrote:
>
> On 27-8-2012 4:14, Matthew Meyer wrote:
>
> > So the question: Is there a way I can keep the fle
On 27-8-2012 4:14, Matthew Meyer wrote:
> So the question: Is there a way I can keep the flexible tag regex redirect
> behavior but then "break" from it once I reach a product page? One
> important thing to note is that I want to keep the product page within the
> bu
(slug=slug)
return render(request, 'shop/product_page.html', {'product': product})
along with the following url configurations:
url(r'^(?P.+)/$', 'tag_page'),
url(r'^(?P.+)/(?P[-\w]+)/$', 'product_page'),
The regex that has "tag&quo
On 3-8-2012 2:34, Melvyn Sopacua wrote:
Correction:
> url(r'^(?P\w[\w-]+-/$', 'detail')
insert question mark here --> ?
--
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@googl
On 26-7-2012 16:45, Joe wrote:
> Hey, I have a url regex like this which is keeping django extremely busy
> (20secs to 1min to handle a request). On some urls it even crashes.
>
> my regex:
>
> url(r'^(?P(\w+-?)*)/$', 'detail'),
Turn the * into a + and yo
On 07/26/12 09:45, Joe wrote:
> url(r'^(?P(\w+-?)*)/$', 'detail'),
>
> replaced with:
>
> url(r'^(?P[\w-]+)/$', 'detail'),
Russell gave you good background on the why (including that Django
was stung by the same issue). It would help if you more clearly
defined what you wanted to target. Your
On Thu, Jul 26, 2012 at 10:45 PM, Joe wrote:
> Hey, I have a url regex like this which is keeping django extremely busy
> (20secs to 1min to handle a request). On some urls it even crashes.
>
> my regex:
>
> url(r'^(?P(\w+-?)*)/$', 'detail'),
>
>
>
Hey, I have a url regex like this which is keeping django extremely busy
(20secs to 1min to handle a request). On some urls it even crashes.
my regex:
url(r'^(?P(\w+-?)*)/$', 'detail'),
view:
def detail(request, item_url):
i = get_object_or_404(Page, url=item_url,publi
On 06/28/12 01:42, pakyazilim wrote:
> i have text ;
> **
>A
>
> B
>
>
> **
> *
> *
> *i want to remove first end for text end tag. *
> *how can i it?*
Depends on what you want to happen in various odd edge-cases:
- what happens if other tags surround the outside bl
You could use regular expressions to parse the string, break it up
into chunks and simply remove the first and last chunk (or whatever
you're looking for)
Also, you could use a DOM Parser to parse this tree and remove the
outer-most . Just make sure you don't remove the entire DOM Tree
within the U
first is s='**
A
B
**'
s.replace('' ,' ', 1 )
but i dont remove last tag.
2012/6/28 pakyazilim
> i have text ;
> **
>A
>
> B
>
>
> **
> *
> *
> *i want to remove first end for text end tag. *
> *how can i it?*
> *thanks you...*
>
> --
>
i have text ;
**
A
B
**
*
*
*i want to remove first end for text end tag. *
*how can i it?*
*thanks you...*
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.goo
Hello list
I know, this question has been posted and resolved before, but the
solutions don't work in my situation. I don't know why.
When I try to use the "url" tag in any template an exception is raised:
"'str' object has no attribute 'regex
I changed to your regex and it works fine. Thanks a lot :)
Thanks and Regards,
Swaroop Shankar V
On Sun, Apr 22, 2012 at 2:37 PM, yati sagade wrote:
> I think that one also matches upto one whitespace character(space, tab or
> newline) within the username(The \s).
>
>
> On Su
I think that one also matches upto one whitespace character(space, tab or
newline) within the username(The \s).
On Sun, Apr 22, 2012 at 2:12 PM, Swaroop Shankar V wrote:
> Thanks a lot for your reply. I just found an regex from some blog which is
> as follows
>
> (r'^user/(
Thanks a lot for your reply. I just found an regex from some blog which is
as follows
(r'^user/([\w\'\.\-]+\s?[\w\'\.\-]+)/$','accounts.views.userProfile'),
and this seems to be working fine. Have not tested all the use cases for
this regex, but anyway username wi
/(\w+)/$','accounts.views.userProfile'),
>
> this working fine for normal usernames, but if the user add a . (dot) in
> between his username the url do not match with the regex and throws Page
> not found error.
>
> Since the django username supports Letters, digi
king fine for normal usernames, but if the user add a . (dot) in
between his username the url do not match with the regex and throws Page
not found error.
Since the django username supports Letters, digits and @/./+/-/_ i want
all these to be supported in my url. Could someone please help me to
c
This is corrected question. The first time it was submitted on
2011.11.22 nd.
I am not able to save string with special characters, such as θæŋ
after re.search(string).
#saving to the model Textfield does not work. Instead of θæŋkfəli, i
am getting shown "\xce\xb8\xc3\xa6\xc5\x8bkf\xc9\x99li" in A
On Thursday, 13 October 2011 23:58:00 UTC+1, Victor Hooi wrote:
>
> Hi,
>
> I have Django model and in one of the fields I need to store a regex string
> that I can later use.
>
> class Foo(models.Model):
> name = models.CharField(max_length=30, unique=
Hi,
I have Django model and in one of the fields I need to store a regex string
that I can later use.
class Foo(models.Model):
name = models.CharField(max_length=30, unique=True)
regex_string = models.TextField()
So for example, the regex_string field might be set to:
r'\d{2}
Thanks but I still have problem.
My URLConf is like this:
Thank you very much.
Problem Solved :)
On May 23, 1:39 pm, Tom Evans wrote:
> On Mon, May 23, 2011 at 10:25 AM, Pedram wrote:
> > Hello,
> > I have a regular expression for usernames and I want to use this regex
> &
On Mon, May 23, 2011 at 10:25 AM, Pedram wrote:
> Hello,
> I have a regular expression for usernames and I want to use this regex
> in my URLConf and bind that to a view. The problem is, I have
> parenthesis in my regex which should not consider as *args*. Here's my
> re
Hello,
I have a regular expression for usernames and I want to use this regex
in my URLConf and bind that to a view. The problem is, I have
parenthesis in my regex which should not consider as *args*. Here's my
regex:
^[a-zA-Z0-9]+((\.[a-zA-Z0-9]+)|(_[a-zA-Z-0-9]+))*$
Values in
You need to use mark_safe. Otherwise Django will be protecting you from
potential malicious input.
http://docs.djangoproject.com/en/1.3/ref/utils/#django.utils.safestring.mark_safe
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to thi
Hello. I am using Django 1.3 on Windows XP.
I read a tutorial and the code below transforms the words like MyLink
into a html link.
But the output that I achieved is the HTML markups of the link, not
the link itself.
How to solve that?
Thank you.
wikilink = re.compile("\\b([A-Z][a-z]+[A-Z][a-z]+)\
On Apr 3, 11:58 pm, Karen Tracey wrote:
> On Sun, Apr 3, 2011 at 11:35 PM, xiao_haozi wrote:
> > I'm running into some perplexing regex issues in urls.py and getting
> > to my admin section.
> > It worked before but now that I have another view added in, anything
>
On Sun, Apr 3, 2011 at 11:35 PM, xiao_haozi wrote:
> I'm running into some perplexing regex issues in urls.py and getting
> to my admin section.
> It worked before but now that I have another view added in, anything
> beyond the index regex is getting fed into the "url/&
I'm running into some perplexing regex issues in urls.py and getting
to my admin section.
It worked before but now that I have another view added in, anything
beyond the index regex is getting fed into the "url/" section rather
than admin:
I've included my urls.py section and
Have you done any performance testing? From what I understand pythons
re.compile caches internally, so after the first call subsequent calls
will use the pre-compiled expression. Serializing the compiled
expression using pickle isn't 'free', so I'm wondering how much
difference there is in practi
On Fri, Feb 11, 2011 at 11:18 AM, Santiago Caracol
wrote:
> There is no point in storing the regex strings in a pickle field. I
> already have the regex strings in ordinary django fields. What I want
> to store is *compiled* regular expressions in order to be able to use
> them witho
On Fri, Feb 11, 2011 at 4:18 PM, Santiago Caracol
wrote:
>> Since the pickled value is a string, it should work in fixtures.
>
> There is no point in storing the regex strings in a pickle field. I
> already have the regex strings in ordinary django fields. What I want
> to
You're forgetting the pickle part. That's what the getter and setter
are for in my previous description.
import re
import pickle
pattern = re.compile(r'^\w{3}\s+\d{3}')
x = pickle.dumps(pattern)
type(x)
If you store 'x' in your database you won't have any difficulty with fixtures.
Shawn
--
> Since the pickled value is a string, it should work in fixtures.
There is no point in storing the regex strings in a pickle field. I
already have the regex strings in ordinary django fields. What I want
to store is *compiled* regular expressions in order to be able to use
them without having
The picklefield stores strings. So when you say "regexes can't be
stored in fixtures," it implies that you're dealing with something
other than strings at that point. Have you tried the pickle field? As
I understand it, it's equivalent to this manual process:
Create a normal text field.
> http://pypi.python.org/pypi/django-picklefield/0.1
Thanks for the tip. This works, but it has one great disadvantage: The
regexes can't be stored in fixtures. They are stored in the database
directly. So it seems I would have to insert all my several thousand
products manually again. And if I ch
and
> store the regular expression only once: at the time when the new
> product is saved.
>
> However, there doesn't seem to be a models.RegexField. There is a
> forms.RegexField, but I don't understand how I could use it in the
> product model.
>
> Any tips how to s
could use it in the
product model.
Any tips how to store the compiled regex?
Santiago
--
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 grou
sing the URLconf defined in sunlight.urls, Django tried these URL
> patterns, in this order:
>
> 1. ^admin/doc/
> 2. ^admin/(.*)
> 3. ^[/]$
> 4. req/
>
> The current URL, start/, didn't match any of these.
>
> So it looks like it isn't properly
d (404)
Request Method: GET
Request URL:http://server2/start/
Using the URLconf defined in sunlight.urls, Django tried these URL
patterns, in this order:
1. ^admin/doc/
2. ^admin/(.*)
3. ^[/]$
4. req/
The current URL, start/, didn't match any of these.
So it looks like
s%40cdu.edu.au/
>
> I don't care about whether this is a valid email string I simple want
> to pass the parameter across to the view and do the look up here.
>
> I notice the @ is already %40 which has been escaped by the Javascript
> in the calling application.
>
> In
It sounds like this might be a good case for a GET (querystring).
As in:
http://localhost:8000/contact/?email=ronald.ninnis%40cdu.edu.au/
Then use something like request.GET.get('email', '') to get the value.
That seems easier and cleaner than trying to have a URL patter
this is a valid email string I simple want
to pass the parameter across to the view and do the look up here.
I notice the @ is already %40 which has been escaped by the Javascript
in the calling application.
In my urls.py I have the following regex.
urls.py
(r'^contact/(?P\[a-z0-9._%+.
On Fri, 2009-10-09 at 12:21 -0700, davisd wrote:
> Sorry for the public disclosure... I did email django security after
> I posted. I'm just getting into this open source goodness and I'm not
> really sure how it's supposed to operate yet.
>
> I did consult the documentation:
> http://docs.dja
Just as an update for anyone following this thread:
This was indeed a security exploit, and it has been fixed. See
http://www.djangoproject.com/weblog/2009/oct/09/security/ for details.
Jacob
--~--~-~--~~~---~--~~
You received this message because you are subscri
On Fri, Oct 9, 2009 at 3:21 PM, davisd wrote:
>
> I'm wondering if a multithreaded webserver setup would be more guarded
> against this sort of thing?
>
>
Yeah, but. When I tried this on my own production server (Apache/mod_wsgi)
the process handling the request that caused the problem was kille
Sorry for the public disclosure... I did email django security after
I posted. I'm just getting into this open source goodness and I'm not
really sure how it's supposed to operate yet.
I did consult the documentation:
http://docs.djangoproject.com/en/dev/internals/contributing/
Jacob:
I'm run
Yes.
We've confirmed the problem. We're working on a patch.
In the meantime, everybody go meditate on the documentation for how to
report security issues.
--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."
--~--~-~--~~~---~--~~
Yo
Take a look at mine:
*In [41]: from django.forms.fields
django.forms.fields
In [41]: from django.forms.fields import email_re
In [42]:
email_re.match('viewx3dtextx26q...@yahoo.comx26latlngx3d15854521645943074058
')*
and this is what top shows:
*
PID USER PR NI VIRT RES SHR S %CPU %ME
ail_re.match
> ('viewx3dtextx26q...@yahoo.comx26latlngx3d15854521645943074058')
>
> will cause CPU to shoot up 100% and the process will hang forever.
>
> Since this is the regex used to validate EmailField on forms, won't
> this DOS a live site?
>
> Where should I report t
After hours of debugging, I found that:
from django.forms.fields import email_re
email_re.match
('viewx3dtextx26q...@yahoo.comx26latlngx3d15854521645943074058')
will cause CPU to shoot up 100% and the process will hang forever.
Since this is the regex used to validate EmailFiel
Karen Tracey wrote:
> On Tue, Oct 6, 2009 at 1:32 PM, Mat wrote:
>
>> Okay so here is my code:
>>
>> **This way works and does not error**
>> rs = BadActor.objects.filter(addr__iregex='^(192\.188\.)(.*)(\.20)$');
>> print len(rs);
>> print rs[0].addr
>>
>> ***This way errors
On Tue, Oct 6, 2009 at 1:32 PM, Mat wrote:
>
> Okay so here is my code:
>
> **This way works and does not error**
> rs = BadActor.objects.filter(addr__iregex='^(192\.188\.)(.*)(\.20)$');
> print len(rs);
> print rs[0].addr
>
> ***This way errors
> q = Q({'addr__iregex':'^(192\
Okay so here is my code:
**This way works and does not error**
rs = BadActor.objects.filter(addr__iregex='^(192\.188\.)(.*)(\.20)$');
print len(rs);
print rs[0].addr
***This way errors
q = Q({'addr__iregex':'^(192\.188\.)(.*)(\.20)$'});
rs = BadActor.objects.filter(q);
print
Hi Karen,
On 28 Sep., 22:49, Karen Tracey wrote:
> On Mon, Sep 28, 2009 at 4:00 PM, janedenone wrote:
>
> > Hi,
>
> > this
>
> > pages = Page.objects.exclude(content__iregex=r'^[\n\r \t]*<')
>
> > should deliver the same rows as this
>
> > SELECT ... FROM pages WHERE (content NOT REGEXP '^[\n\r
On Mon, Sep 28, 2009 at 4:00 PM, janedenone wrote:
>
> Hi,
>
> this
>
> pages = Page.objects.exclude(content__iregex=r'^[\n\r \t]*<')
>
> should deliver the same rows as this
>
> SELECT ... FROM pages WHERE (content NOT REGEXP '^[\n\r \t]*<')
>
> but it does not: The Django query delivers 468 rows
Hi,
this
pages = Page.objects.exclude(content__iregex=r'^[\n\r \t]*<')
should deliver the same rows as this
SELECT ... FROM pages WHERE (content NOT REGEXP '^[\n\r \t]*<')
but it does not: The Django query delivers 468 rows, whereas the SQL
query delivers 223. It could be that the Django quer
I've run into a strange problem using Django's [i]regex search with
non-ascii characters.
I'm using the [i]regex in the following manner:
begin code
class Tag(models.Model):
def __unicode__(self):
return self.keyword
keyword = models.CharField(max_len
My noob error: I had extra "portal/" on my regex.
Sorry and thanks for your attention.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send e
On Sep 6, 3:52 pm, Karen Tracey wrote:
> On Sun, Sep 6, 2009 at 1:36 AM, Jim Myers wrote:
>
> > Thanks, but that doesn't do it either.
> > I changed the regex to:
>
> > ^portal/student/(?P\S+)/profile_edit/$
>
> > and it still doesn't match :(
>
On Sun, Sep 6, 2009 at 1:36 AM, Jim Myers wrote:
>
> Thanks, but that doesn't do it either.
> I changed the regex to:
>
> ^portal/student/(?P\S+)/profile_edit/$
>
> and it still doesn't match :(
>
>
It should:
>>> import re
>>> re.match(r
Thanks, but that doesn't do it either.
I changed the regex to:
^portal/student/(?P\S+)/profile_edit/$
and it still doesn't match :(
On Sep 5, 9:44 pm, Karen Tracey wrote:
> On Sat, Sep 5, 2009 at 11:32 PM, Jim Myers wrote:
>
> > Hi, I'm using this regex in urls.
On Sat, Sep 5, 2009 at 11:32 PM, Jim Myers wrote:
>
> Hi, I'm using this regex in urls.py:
>
> r'^portal/student/(?P\S+)/profile_edit$'
>
> There's no trailing slash on this regex, but there is an end of string
marker ($). So a match will have to end
Hi, I'm using this regex in urls.py:
r'^portal/student/(?P\S+)/profile_edit$'
to try to match this url:
http://dd..org/portal/student/xx.yy/profile_edit/
It's supposed to put "xx.yy" into userid parameter and match and use
the associated view.
But it does
On Jun 29, 2:57 pm, Joru wrote:
> Still doesn't work even I remove wrap function :(
So it seems your regex is incorrect, the problem is not related to
Django. If you paste your code here I can have a look, but I still
think you'd be better off reading a bit more about regula
1 - 100 of 208 matches
Mail list logo