Skip to content

Instantly share code, notes, and snippets.

View sonthonaxrk's full-sized avatar
👁️
Focusing

RK sonthonaxrk

👁️
Focusing
View GitHub Profile
#urls.py
urlpatterns = patterns('',
url(r'^profile/$', login_required(views.BaseView.as_view(
template_name='profile_view.html' testVariable='testing' )), name='profile'),
)
#views.py
class BaseView(TemplateView):
#urls.py
urlpatterns = patterns('',
url(r'^profile/$', login_required(views.BaseView.as_view(
template_name='profile_view.html' testVariable='testing' )), name='profile'),
)
#views.py
class BaseView(TemplateView):
@sonthonaxrk
sonthonaxrk / models.py
Last active August 29, 2015 14:14 — forked from anonymous/models.py
class User(AbstractBaseUser, PermissionsMixin):
class Meta:
abstract = False
USERNAME_FIELD = 'email'
account_type = models.IntegerField(choices=ACCOUNT_TYPES, default=2)
first_name = models.CharField(max_length=30)
middle_names = models.CharField(max_length=30)
@sonthonaxrk
sonthonaxrk / models.py
Last active August 29, 2015 14:14 — forked from anonymous/models.py
class User(AbstractBaseUser, PermissionsMixin):
class Meta:
abstract = False
USERNAME_FIELD = 'email'
account_type = models.IntegerField(choices=ACCOUNT_TYPES, default=2)
first_name = models.CharField(max_length=30)
middle_names = models.CharField(max_length=30)
Environment:
Request Method: GET
Request URL: http://localhost:8000/profile/users/
Django Version: 1.7.4
Python Version: 3.4.2
Installed Applications:
('django.contrib.admin',
{
"url": "https://api.localhost:8000/users/3/",
"first_name": "Steven ",
"last_name": "Konig",
"email": "stephen@example.com",
"profile-image": "https://fbcdn-profile-a.akamaihd.net/profile_picture.jpg",
"age": 36,
"profiles": {
"customer_profile_url": "https://api.localhost:8000/customers/3/",
"vendor_profile_url": "https://api.localhost:8000/vendors/3/"
var SearchBar = React.createClass({
render: function() {
return (
<div className="search-large-wrap">
<div className="search-large-textfield-wrap">
<input placeholder="Search For Existing Products" type="search" className="search-large-textfield" id="search-products"></input>
</div>
<div className="search-large-submit-wrap">
<button type="button" className="search-large-submit" id="add-products" >Continue</button>
</div>
function myFunction() {
console.log("Hello World");
}
var SearchBar = React.createClass({
render: function() {
return (
<button type="button" onClick= { myFunction() } >Continue</button>
);
},
var ProductSearch = React.createClass({
filterList: function(event){
//debugger;
var updatedProducts = this.state.initialProducts;
updatedProducts = updatedProducts.filter(function(item){
return item.name.toLowerCase().search(event.target.value.toLowerCase()) !== -1;
});
this.setState({filteredProducts: updatedProducts});
},
React.render(
<MainViewContainer/>,
document.getElementById("main-area")
);
React.render(
<MainSideMenu/>,
document.getElementById("sidemenu-nav")
);